-
-
Notifications
You must be signed in to change notification settings - Fork 5k
router.resolve
did not handle <base>
correctly
#3819
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
Comments
A base should likely not include a hash in it. Note that it changes the browser behavior of |
I have tested Another main problem is that It's less reliable here: vue-router/src/history/base.js Lines 270 to 288 in 492bf0e
The hash mode should not join the '/' in the middle, the server may return 404 Not Found. Lines 280 to 283 in 492bf0e
To solve the problem of inconsistent opening in new tabs in hash mode, it can either do nothing special for |
* Resolve the href in `<base>` correctly. * In hash mode, the hash in base is automatically removed and the base trailing slash is distinguished. * By default the result of `router.resolve().href` is the same as the actual switched URL.
* Resolve the href in `<base>` correctly. * In hash mode, the hash in base is automatically removed and the base trailing slash is distinguished. * By default the result of `router.resolve().href` is the same as the actual switched URL.
Version
3.6.5
Reproduction link
5s3iuf.csb.app/root/main.html
Steps to reproduce
Click on Link A or open Link B in a new tab.
And check the generated href attribute in the inspector.
What is expected?
In hash mode, the following results are logical, I would prefer the last one, because the
HashHistory
is not related to thebaseURI
and the availability of the<base>
source is unknown.What is actually happening?
The generated href attributes are all
"/./rel/path#/foo/#/bar"
.Both the relative path and the hash of Link A are not handled correctly.
Link B has the same issue when opened in a new tab.
The text was updated successfully, but these errors were encountered: