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: only encode non dynamic path params #8421

Merged
merged 2 commits into from
Dec 1, 2020
Merged

fix: only encode non dynamic path params #8421

merged 2 commits into from
Dec 1, 2020

Conversation

pi0
Copy link
Member

@pi0 pi0 commented Dec 1, 2020

Types of changes

  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

Only encode non dynamic route paths. Resolves #8420

Context: #8325 (with this PR, custom router is responsible to encode routes)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly. (PR: #)
  • I have added tests to cover my changes (if not applicable, please state why)
  • All new and existing tests are passing.

Sorry, something went wrong.

@pi0 pi0 requested review from atinux and clarkdo December 1, 2020 13:11
@pi0 pi0 changed the base branch from dev to 2.x December 1, 2020 13:13
@codecov-io
Copy link

codecov-io commented Dec 1, 2020

Codecov Report

Merging #8421 (1cf7a17) into 2.x (68d8fb8) will decrease coverage by 0.19%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##              2.x    #8421      +/-   ##
==========================================
- Coverage   68.26%   68.07%   -0.20%     
==========================================
  Files          91       91              
  Lines        3901     3912      +11     
  Branches     1065     1069       +4     
==========================================
  Hits         2663     2663              
- Misses       1004     1012       +8     
- Partials      234      237       +3     
Flag Coverage Δ
unittests 68.07% <100.00%> (-0.20%) ⬇️

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

Impacted Files Coverage Δ
packages/utils/src/route.js 93.20% <100.00%> (+0.04%) ⬆️
packages/webpack/src/utils/style-loader.js 80.85% <0.00%> (-2.13%) ⬇️
packages/webpack/src/builder.js 12.72% <0.00%> (-0.61%) ⬇️
packages/vue-renderer/src/renderers/ssr.js 0.00% <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 68d8fb8...1cf7a17. Read the comment docs.

@pi0 pi0 merged commit 49c293b into 2.x Dec 1, 2020
@pi0 pi0 deleted the fix/route-encoding branch December 1, 2020 15:01
@ydnar
Copy link

ydnar commented Dec 1, 2020

We just encountered a similar bug in our @domainr website frontend. We have tests that caught a URI-encoded param in a route. Previously, a , was decoded correctly. This is in the current latest version of Nuxt and vue-router.

@pi0
Copy link
Member Author

pi0 commented Dec 2, 2020

Released as hotfix v2.14.9. @ydnar if still had issue, please open an issue :)

@rchl
Copy link

rchl commented Dec 2, 2020

What about routes like this one: https://github.com/vuejs/vue-router/blob/2c757a1cdc3aa8d55c3e3e22788a89f2351e58a0/examples/route-matching/app.js#L24
?

From a quick look at the code, it seems like it encodes all routes that are non-dynamic but routes can be non-dynamic and contain regexp which will break when encoded.

@pi0
Copy link
Member Author

pi0 commented Dec 2, 2020

@rchl Kindly please use a reproduction/issue. Last change only tries to encode auto scanned directories (createRoutes) which do not support this convention.

@rchl
Copy link

rchl commented Dec 2, 2020

Sounds good. Was just pointing out a potential issue without looking much at the code as I don't have time to dig into it now.

@ydnar
Copy link

ydnar commented Dec 2, 2020

Released as hotfix v2.14.9. @ydnar if still had issue, please open an issue :)

Still broken. I’ll file an issue!

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.

Custom routes not working after upgrading to v2.14.8
7 participants