Skip to content

Fix duplicate query string params when hashbang is enabled#584

Open
jasonwoan wants to merge 1 commit into
visionmedia:masterfrom
jasonwoan:fix/duplicate-qs
Open

Fix duplicate query string params when hashbang is enabled#584
jasonwoan wants to merge 1 commit into
visionmedia:masterfrom
jasonwoan:fix/duplicate-qs

Conversation

@jasonwoan
Copy link
Copy Markdown

Problem

When hashbang is enabled, page.start() will re-add location.search params to the hash. This results in duplicate query params when the page is refreshed.

See #525 and #412

Proposed Fix

Add location.search params only when a query string has not been added to the hash.

Notes

It was a challenge to test this. I couldn't figure out how to supply a query string to the iframe window. I ended up configuring jsdom with a query string and testing against window.location. Please advise if there is a better approach.

@coveralls
Copy link
Copy Markdown

coveralls commented Jan 24, 2021

Coverage Status

Coverage increased (+0.4%) to 93.443% when pulling 5ce2222 on jasonwoan:fix/duplicate-qs into 4f99916 on visionmedia:master.

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.

3 participants