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

fix(generator): decode path with ufo #9739

Merged
merged 1 commit into from Sep 7, 2021
Merged

fix(generator): decode path with ufo #9739

merged 1 commit into from Sep 7, 2021

Conversation

danielroe
Copy link
Member

@danielroe danielroe commented Aug 31, 2021

Types of changes

  • Bug fix (a non-breaking change which fixes an issue)

Description

Since unjs/ufo#32 (line) & is encoded (and is not decoded by decodeURI). This means that & in a path component is being preserved as %26 rather than decoded:

encodeURI('test & another test')
// "test%20&%20another%20test"
decodeURI('test%20%26%20another%20test')
// "test %26 another test"

This PR uses the decode function from ufo to ensure consistency between encoding/decoding. (url is normalised with ufo here)

resolves #9734

Checklist:

  • All new and existing tests are passing.

@danielroe danielroe requested a review from pi0 August 31, 2021 20:44
@danielroe danielroe self-assigned this Aug 31, 2021
@codecov-commenter
Copy link

codecov-commenter commented Aug 31, 2021

Codecov Report

Merging #9739 (0c2f6e4) into dev (2ef0537) will not change coverage.
The diff coverage is 0.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##              dev    #9739   +/-   ##
=======================================
  Coverage   65.17%   65.17%           
=======================================
  Files          94       94           
  Lines        4109     4109           
  Branches     1127     1127           
=======================================
  Hits         2678     2678           
  Misses       1152     1152           
  Partials      279      279           
Flag Coverage Δ
unittests 65.17% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
packages/generator/src/generator.js 82.48% <0.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 2ef0537...0c2f6e4. Read the comment docs.

@pi0 pi0 merged commit dfcc26e into dev Sep 7, 2021
@pi0 pi0 deleted the fix/decode-generator-path branch September 7, 2021 16:40
@pi0 pi0 mentioned this pull request Jun 23, 2022
@danielroe danielroe added the 2.x label Jan 18, 2023
This was referenced Jan 19, 2023
@danielroe danielroe mentioned this pull request Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nuxt generate static mode still calls asyncData in nuxt-edge
4 participants