Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finicky doesn't handle URL ending with escaped query params \?ls\=1\&mt\=12 #339

Open
bric3 opened this issue Oct 16, 2024 · 0 comments
Open
Labels

Comments

@bric3
Copy link

bric3 commented Oct 16, 2024

Describe the bug
A clear and concise description of what the bug is.

For some reason I had a link where special characters like this ?, &, =. were escaped

https://itunes.apple.com/app/calendar-366-ii/id1265895169\?ls\=1\&mt\=12

And I noticed that, nothing gets logged in Finicky console. However when using the Finicky console and pasting the URL the handler configuration is picked up and logs something.

Correct URL
image

Incorrect escaped URL
image

The issue is not about fixing badly escaped URL but the lack of logging.

Your configuration

module.exports = {
  handlers: [
    {
      // https://itunes.apple.com/app/calendar-366-ii/id1265895169?ls=1&mt=12
      // https://apps.apple.com/us/app/calendar-366-ii/id1265895169
      match: [
        finicky.matchDomains("apps.apple.com"),
        "itunes.apple.com/app/*"
      ],
      url: ({url, urlString}) => {
        if (url.host === "apps.apple.com") return url
        finicky.log("Rewriting iTunes Store Url " + urlString)
        return {
          protocol: url.protocol,
          host: "apps.apple.com",
          pathname: "/us" + url.pathname,
          search: '' // query params
        };
      },
      browser: "App Store",
    },
  ]
}

To Reproduce
Steps to reproduce the behavior:

  1. Create a simple html document and add the escaped link: https://itunes.apple.com/app/calendar-366-ii/id1265895169?ls=1&mt=12
  2. Click on this link from another app than the browser that understand links, could be iTerm, IntelliJ IDEA, or else.
    image
  3. See nothing is logged.
@bric3 bric3 added the bug label Oct 16, 2024
@bric3 bric3 changed the title Finicky doesn't handle URL ending with \?ls\=1\&mt\=12 Finicky doesn't handle URL ending with escaped query params \?ls\=1\&mt\=12 Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant