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

break(url): handle decodes correctly; trim ParsedURL properties #165

Merged
merged 9 commits into from
May 23, 2021

Conversation

lukeed
Copy link
Owner

@lukeed lukeed commented May 23, 2021

Took the opportunity to make it a breaking change:

  • removed useless keys on ParsedURL interface
  • use named parse export instead of default function

Technically, this means it's a breaking change for Polka too. Specifically, the req.url is no longer fully decoded.
Now, req.url is the decoded req.path segment concatenated with the NOT-decoded req.search segment. Before this change, the req.url was comprised of a decoded req.search segment too... which often caused problems in userland.

The raw, fully-encoded value is always still available as req.originalUrl ... unless you change it.

Lastly, revamped the @polka/url benchmarks and it looks like it got a bit of a speed boost too 🚀


Closes #150

@codecov-commenter
Copy link

codecov-commenter commented May 23, 2021

Codecov Report

Merging #165 (8e45667) into next (de206c3) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##              next      #165   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            4         4           
  Lines          117       108    -9     
=========================================
- Hits           117       108    -9     
Impacted Files Coverage Δ
packages/polka/index.js 100.00% <100.00%> (ø)
packages/url/index.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update de206c3...8e45667. Read the comment docs.

@lukeed lukeed merged commit 66f9cc5 into next May 23, 2021
@lukeed lukeed deleted the fix/urlencode branch May 23, 2021 02:01
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.

2 participants