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

Consecutive Slashes in URL #48

Open
jeansimoncollard opened this issue Mar 19, 2019 · 2 comments
Open

Consecutive Slashes in URL #48

jeansimoncollard opened this issue Mar 19, 2019 · 2 comments

Comments

@jeansimoncollard
Copy link

jeansimoncollard commented Mar 19, 2019

I'm submitting a bug report

  • Library Version:
    1.3.0

Please tell us about your environment:

  • Operating System:
    Windows 10

  • NPM Version:
    6.4.1

  • Browser:
    At least Chrome 73.0.3683.75 and Internet Explorer

  • Language:
    TypeScript

Current behavior:

When the URL has double slashes (example: http://localhost:9000//route?parm1=... or http://localhost:9000/route1//route2?parm1=...), history.replaceState will remove the double slashes. This will produce the following security error because the two URLs don't match anymore:

Unhandled rejection SecurityError: Failed to execute 'replaceState' on 'History': A history state object with URL [...] cannot be created in a document with origin 'http://localhost:9000' and URL [...].

Steps to reproduce
Add an extra slash to have two consecutive slashes inside any route of your Aurelia app

Expected behavior

Url should be insensitive to the number of consecutive slashes

Use Case

We have an external partner with a very long release cycle who is calling us with two consecutive slashes

@EisenbergEffect
Copy link
Contributor

@jeansimoncollard If you'd be willing to create a PR to normalize the URLs before we call the history APIs internally, we'd be happy to accept that.

@davismj
Copy link
Member

davismj commented Mar 20, 2019 via email

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

No branches or pull requests

3 participants