-
-
Notifications
You must be signed in to change notification settings - Fork 5k
With routerBase being "/a/", landing on "/app" is incorrectly redirected to "/a/pp" #3555
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
The thing is if your base is /a/, it shouldn't be possible to access your application at /app/, only at /a/app. |
Thank you but I don't think that's the right fix because if your app can be served at |
Thanks for your response @posva. I hear what you are saying, and as I mentioned before I totally agree that the actual fix for the situation should be in the LoadBalancer/Proxy who routes Disambiguating 2 ProblemsLet's imagine the case that the developer has set to forward Now, having the router of the app redirect Different
|
|
This reverts commit 5f42a2a.
Wait, are we talking about the same PR? Who uses When @yyx990803 first wrote this logic of I just improved his logic to be more accurate. I am pretty confident that if he, in 2016, could think of the case of Here is a screenshot of my PR. I am pretty sure it is not common in the open-source community and GitHub, to post a screenshot of the single line of code you are changing in PR, but I rather keep the conversation relevant. It's becoming personally offensive to me that I spend time providing details, and then I receive a random irrelevant response, which is not even related to my PR or helping with the problem we are talking about. Here are questions for you:
PS. I am not blocked by this PR. I just wanted to give back to the Vue and VueRouter communities. And I personally prefer to contribute more to the projects that its moderators care about volunteer contributors like me, at least half as much I care about their project. So, if you think this ticket/PR should be closed, I will keep that in mind and walk away. |
I switched both values in my brain. Now it makes sense. |
Version
3.5.1
Reproduction link
https://jsfiddle.net/eyedean/4qcd9kgy/21/
Steps to reproduce
It's hard to reproduce in the jsfiddle and such. That's what I mentioned in the
TODO
section of the link above.Actual reproduction
/a/
.www.mydomain.com/bpp/
, VueRouter properly shows the App's 404 (catch on/*/
in routes) page.www.mydomain.com/app
, then Vue Router redirects it towww.mydomain.com/a/pp
which is not expected. (Assume/a/pp
is an existing page, and not the intended target of/app
)What is expected?
show 404 on
/app
, just like/bpp
.What is actually happening?
redirects it to
/a/pp
, which can be a different existing page.I tried to debug this on my own. Here is what I found.
When I set VueRouterBase to
/a/
(with trailing slash, as advised in the documentation),router.options.base
is properly/a/
, but thehistory.base
is going throughnormalizeBase
and becomes/a
. That's why/app
gets sliced (viavue-router/src/history/html5.js
Lines 90 to 92 in 677f3c1
path: "/pp"
.I also tried getting around this by setting routerbase to
/a//
(double trailing slash). It stopped the/app
=>/a/pp
redirect, successfully, but then all my links were ugly! (e.g.<router-link to="/login">
would producewww.mydomain.com/a//login
with double slash in between.)The text was updated successfully, but these errors were encountered: