-
Notifications
You must be signed in to change notification settings - Fork 960
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
Ignore <base href> in hash history replace #577
Ignore <base href> in hash history replace #577
Conversation
This would also fix an issue we have. We use history for a widget-based app, which is loaded by another website. Those sites load the widgets in various locations. When our widget is loaded, the redirect always leads to {base-href}/# which is not always correct. Let's say the base-href is "https://some.domain/" and the widget is loaded on page "https://some.domain/test/location" the redirect leads to but should lead to https://some.domain/test/location#/ So please check and merge this. If there's anything I can do to help, just let me know. Thank you very much. |
I would very much like to see this one resolved |
Why is behaving like IE the desired outcome? Why not make IE behave like all the other browsers? |
If I remember correctly this is not about browser inconsistency, but about being able to use HashRouter even when your page has a base tag in its markup (which people are saying might've been put there by another system that you have no control over). The intent of that So, regardless of the underlying bugs and browser inconsistencies, the expectation is that when you navigate to a page with a it will redirect in all browsers to: instead of: |
Thanks for clarifying, @microbouji :) IIRC the current code intentionally respects the I was probably thinking about HTML links, and how when you click on them they (usually) do a push, and since links incorporate the Anyway, happy to merge this but it is technically a breaking change, so it'll be released in our next major. |
Actually, no, I take that back. This is not a breaking change because |
Fixes #574 dealing with
createHashHistory
's support for the<base>
tag. I didn't know how to simulate full-page refresh navigation in the tests but here's how you can manually test it:Edit index.html to have
<base href="/the/base">
in the head and switch to hashHistory. Navigating to the local server without a hash at the end of the url will now redirect you tohttp://localhost:8080/the/base/#/
in all browsers except for IE where it will redirect tohttp://localhost:8080/#/
With this change it always behaves as in IE, redirecting to
http://localhost:8080/#/
in all browsers.The related PR #578 changes the output of
createHref
when a base tag is present.