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

fix(router): require explicit base href #3122

Merged
merged 2 commits into from Jul 17, 2015

Conversation

btford
Copy link
Contributor

@btford btford commented Jul 17, 2015

Previously, calls to getBaseHref used document.baseURI, which defaults to the current path in the absence of a base element in the document. This leads to surprising behavior.

With this change, getBaseHref returns null when a base element is not present in the document, and Location throws a more prescriptive error message.

Closes #3096

@btford btford added type: bug/fix comp: router action: review The PR is still awaiting reviews from at least one requested reviewer effort1: hours labels Jul 17, 2015
@btford btford added this to the alpha-32 milestone Jul 17, 2015
@btford btford force-pushed the fix-facade-explicit-base-href branch from 15e3a47 to 241b842 Compare July 17, 2015 19:19
@caitp
Copy link
Contributor

caitp commented Jul 17, 2015

didn't we find that this caused a lot (a few?) of problems for SVG in 1.x? /cc @jeffbcross

@btford
Copy link
Contributor Author

btford commented Jul 17, 2015

For those cases you can provide a binding to appBaseHrefToken and not have to use a base element.

It might be better for Location to avoid the using the base tag altogether, but that's a more drastic change.

@vsavkin vsavkin added pr_state: LGTM action: merge The PR is ready for merge by the caretaker labels Jul 17, 2015
@btford btford force-pushed the fix-facade-explicit-base-href branch 2 times, most recently from 1c4314f to f3b3325 Compare July 17, 2015 20:53
Previously, calls to getBaseHref used document.baseURI, which defaults
to the current path in the absence of a base element in the document.
This leads to surprising behavior.

With this change, getBaseHref returns null when a base element is not
present in the document.
@btford btford force-pushed the fix-facade-explicit-base-href branch from f3b3325 to 011fab3 Compare July 17, 2015 21:01
@btford btford merged commit 011fab3 into angular:master Jul 17, 2015
@jessegood jessegood mentioned this pull request Aug 5, 2015
@btford btford deleted the fix-facade-explicit-base-href branch October 23, 2015 13:05
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker action: review The PR is still awaiting reviews from at least one requested reviewer cla: yes effort1: hours type: bug/fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HTML5LocationStrategy fails to update path on router.navigate
6 participants