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

Guard against how Browsers encode spaces #36

Merged
merged 1 commit into from
Dec 5, 2024

Conversation

hojberg
Copy link
Contributor

@hojberg hojberg commented Dec 5, 2024

When using the Browser's address bar to perform a search on Share it uses + instead of %20 to encode spaces and this ends up as literal + when parsed with Url.percentDecode. To solve this, replace all + with %20% before calling Url.percentDecode.

Note: this will still work for search queries where the user wants to find "+", which is encoded by Url.percentEncode as %2b.

Fixes #34

When using the Browser's address bar to perform a search on Share it
uses `+` instead of `%20` to encode spaces and this ends up as literal
`+` when parsed with `Url.percentDecode`. To solve this, replace all `+`
with `%20%` before calling `Url.percentDecode`.

Note: this will still work for search queries where the user wants to
find "+", which is encoded by `Url.percentEncode` as `%2b`.
Copy link

netlify bot commented Dec 5, 2024

Deploy Preview for unison-share-ui ready!

Name Link
🔨 Latest commit e9956d6
🔍 Latest deploy log https://app.netlify.com/sites/unison-share-ui/deploys/6752086c82e6d60008e1c213
😎 Deploy Preview https://deploy-preview-36.staging.share.unison-lang.org
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 68 (🔴 down 4 from production)
Accessibility: 93 (no change from production)
Best Practices: 100 (🟢 up 8 from production)
SEO: 75 (no change from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@hojberg hojberg merged commit 770d842 into main Dec 5, 2024
6 checks passed
@hojberg hojberg deleted the guard-against-browser-spaces branch December 5, 2024 20:51
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 this pull request may close these issues.

space in search parameter isn't handled properly
1 participant