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

The exact "+" sign would be decoded as a space #3490

Closed
sinloss opened this issue Jan 14, 2020 · 1 comment · Fixed by #3489
Closed

The exact "+" sign would be decoded as a space #3490

sinloss opened this issue Jan 14, 2020 · 1 comment · Fixed by #3489

Comments

@sinloss
Copy link
Contributor

sinloss commented Jan 14, 2020

Hi all.
I got into this issue while submitting #3489 which involves the + sign. Idk why but the flutter team did use an exact + sign in the releases. And when I changed the checkver in order to support the + sign and tried to autoupdate it, then I got a stubborn error.

After some debugging... It turns out that the [System.Web.HttpUtility]::UrlDecode method in lib/autoupdate.ps1 line 175 unexpectedly ( yet reasonable ) decoded the + of the $basename variable to an empty space. Hence the jsonpath $.releases[?(@.archive =~ /.*$basename/)].sha256 failed

Now that the cause of this issue is clear, may I ask if we could just replace all the + in the $basename part of the URL with a %2B before decoding it or provide a better approach to cope with similar situations?

  • Are there some more special characters that may lead people into this trap?
  • Will the replacing + with %2B harm the other logics?
  • Is there a possibility that some apps do use + to represent a space?

Any ideas?

@linsui
Copy link
Contributor

linsui commented Jan 14, 2020

See ScoopInstaller/Scoop#3721

Ash258 pushed a commit that referenced this issue Jan 30, 2020
- Closes #2439
- Closes #2526
- Closes #2770 
- Closes #2924
- Closes #3113
- Closes #3360
- Closes #3446 
- Closes #3490
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants