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

Initial navigation allows missing the base part #2782

Closed
donne1226 opened this issue May 23, 2019 · 4 comments
Closed

Initial navigation allows missing the base part #2782

donne1226 opened this issue May 23, 2019 · 4 comments
Projects

Comments

@donne1226
Copy link

Version

3.0.3

Reproduction link

https://codesandbox.io/s/pyl49

Steps to reproduce

set url /home or /app/home

What is expected?

/app/home -> direct to home page.
/home -> direct to blank page.

What is actually happening?

/app/home -> direct to home page.
/home -> direct to home page.


I wonder know if this is a bug or feature? And I expect /home should not link to home page, do I use the 'base' option correctly

@Airkro
Copy link

Airkro commented May 30, 2019

same problem

@Naeemo
Copy link

Naeemo commented May 31, 2019

The base prefix in path will be trimmed here, while a path without a leading base will be used directly.

export function getLocation (base: string): string {
let path = decodeURI(window.location.pathname)
if (base && path.indexOf(base) === 0) {
path = path.slice(base.length)
}
return (path || '/') + window.location.search + window.location.hash
}

It looks like a issue to me too, can we change the behavior?

@posva posva added the bug label Sep 13, 2019
@posva posva changed the title question about base option Initial navigation allows missing the base part Sep 13, 2019
@posva
Copy link
Member

posva commented Sep 13, 2019

This should indeed not happen

@posva posva added this to Long term road (high prio, low complex) in Longterm Sep 23, 2019
@posva
Copy link
Member

posva commented Oct 23, 2019

Coming back at this: the point of the base attribute is to allow serving an application from a different folder in your server like example.com/app instead of example.com. This means that the server must serve the application bundle only at /app. It shouldn't be serving an app at the root that uses a base option to /app and this scenario shouldn't exist

@posva posva closed this as completed Oct 23, 2019
@posva posva removed the bug label Oct 23, 2019
@posva posva moved this from Long term road (high prio, low complex) to Done in Longterm Oct 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

4 participants