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(vue-app): sanitize path with trailing slash in getLocation (#6744) #6745

Merged
merged 11 commits into from Jun 30, 2020
Merged

fix(vue-app): sanitize path with trailing slash in getLocation (#6744) #6745

merged 11 commits into from Jun 30, 2020

Conversation

crutch12
Copy link

@crutch12 crutch12 commented Nov 28, 2019

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

Resolves: #6744

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.

pi0
pi0 previously requested changes Nov 28, 2019
packages/vue-app/template/utils.js Outdated Show resolved Hide resolved
@codecov-io
Copy link

codecov-io commented Nov 28, 2019

Codecov Report

Merging #6745 into dev will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##              dev    #6745   +/-   ##
=======================================
  Coverage   64.82%   64.82%           
=======================================
  Files          78       78           
  Lines        2718     2718           
  Branches      706      706           
=======================================
  Hits         1762     1762           
  Misses        729      729           
  Partials      227      227
Flag Coverage Δ
#e2e 100% <ø> (?)
#unit 64.82% <ø> (ø) ⬆️

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 311ff27...6b933d2. Read the comment docs.

@pi0 pi0 dismissed their stale review November 30, 2019 13:56

changes applied

@crutch12
Copy link
Author

crutch12 commented Nov 30, 2019

@pi0 fixed getLocation again, because at first I did mutating with path and it failed tests. Now I don't mutate path
Because of mutating a lot of apps could be crushed :D

UPD:
1 test still crush, but this is not my fault. This test crushes in every pull request

Copy link

@pimlie pimlie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have nothing to add then what I've said before that we should add some sanitation methods to do this for us. It seems we have seen a rise of issues caused by trailing slashes and this is exactly what I was worried about (even though they are probably not all related)

@Elhebert
Copy link

Are there any update about the status of this PR?

We can't update Nuxt in our project as this issue is blocking us. At the moment we are stuck on 2.6.1.

@crutch12
Copy link
Author

I don't know the proper way how to fix my PR to be merged, so I just still waiting :)

@pi0 could you help me with PR?

@codecov-commenter
Copy link

codecov-commenter commented Jun 22, 2020

Codecov Report

Merging #6745 into dev will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##              dev    #6745   +/-   ##
=======================================
  Coverage   70.28%   70.28%           
=======================================
  Files          88       88           
  Lines        3749     3749           
  Branches     1019     1019           
=======================================
  Hits         2635     2635           
  Misses        906      906           
  Partials      208      208           
Flag Coverage Δ
#unittests 70.28% <ø> (ø)

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 6b06ab2...7922557. Read the comment docs.

@pi0
Copy link
Member

pi0 commented Jun 22, 2020

Hi @crutch12 Sure we should merge this fix just as @pimlie mentioned, it is not only source of inconsistencies for baseURL and trailing slash handling. (like regression introduced by #6775 with 2.12). Do you mind adding an e2e test to cover this change? Meanwhile working to make a url utility package to use it on all places instead of depending on sanetization(s)

@crutch12
Copy link
Author

Ok, I'll try

@crutch12
Copy link
Author

@pi0 I've added some e2e tests for checking spa mode router.base (in browser, based on spa fixtures)

Basically with/without trailing slash tests.

Could you check it out?

Copy link
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks awesome! Thanks for your time @crutch12 💚

@pi0 pi0 merged commit b4d3ebf into nuxt:dev Jun 30, 2020
@pi0 pi0 mentioned this pull request Jun 30, 2020
@danielroe danielroe added the 2.x label Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
7 participants