fix(platform-server): correctly handle absolute relative URLs#37341
Closed
CaerusKaru wants to merge 1 commit into
Closed
fix(platform-server): correctly handle absolute relative URLs#37341CaerusKaru wants to merge 1 commit into
CaerusKaru wants to merge 1 commit into
Conversation
alan-agius4
reviewed
Jun 1, 2020
alan-agius4
approved these changes
Jun 1, 2020
alan-agius4
left a comment
Contributor
There was a problem hiding this comment.
LGTM, one small nit.
alxhub
approved these changes
Jun 1, 2020
Member
There was a problem hiding this comment.
Note that this regex also doesn't cover //foo.com/bar URLs, which are absolute paths. I suspect they might work by accident, as they'll be treated as "rooted" by the first /.
Contributor
There was a problem hiding this comment.
@CaerusKaru can you do a followup PR for this please?
Member
Previously, we would simply prepend any relative URL with the HREF for the current route (pulled from document.location). However, this does not correctly account for the leading slash URLs that would otherwise be parsed correctly in the browser, or the presence of a base HREF in the DOM. Therefore, we use the built-in URL implementation for NodeJS, which implements the WHATWG standard that's used in the browser. We also pull the base HREF from the DOM, falling back on the full HREF as the browser would, to form the correct request URL. Fixes angular#37314
atscott
pushed a commit
that referenced
this pull request
Jun 9, 2020
Previously, we would simply prepend any relative URL with the HREF for the current route (pulled from document.location). However, this does not correctly account for the leading slash URLs that would otherwise be parsed correctly in the browser, or the presence of a base HREF in the DOM. Therefore, we use the built-in URL implementation for NodeJS, which implements the WHATWG standard that's used in the browser. We also pull the base HREF from the DOM, falling back on the full HREF as the browser would, to form the correct request URL. Fixes #37314 PR Close #37341
CaerusKaru
added a commit
to CaerusKaru/angular
that referenced
this pull request
Jun 12, 2020
…angular#37341)" This reverts commit 420d1c3.
mhevery
pushed a commit
that referenced
this pull request
Jun 12, 2020
ngwattcos
pushed a commit
to ngwattcos/angular
that referenced
this pull request
Jun 25, 2020
…r#37341) Previously, we would simply prepend any relative URL with the HREF for the current route (pulled from document.location). However, this does not correctly account for the leading slash URLs that would otherwise be parsed correctly in the browser, or the presence of a base HREF in the DOM. Therefore, we use the built-in URL implementation for NodeJS, which implements the WHATWG standard that's used in the browser. We also pull the base HREF from the DOM, falling back on the full HREF as the browser would, to form the correct request URL. Fixes angular#37314 PR Close angular#37341
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
profanis
pushed a commit
to profanis/angular
that referenced
this pull request
Sep 5, 2020
…r#37341) Previously, we would simply prepend any relative URL with the HREF for the current route (pulled from document.location). However, this does not correctly account for the leading slash URLs that would otherwise be parsed correctly in the browser, or the presence of a base HREF in the DOM. Therefore, we use the built-in URL implementation for NodeJS, which implements the WHATWG standard that's used in the browser. We also pull the base HREF from the DOM, falling back on the full HREF as the browser would, to form the correct request URL. Fixes angular#37314 PR Close angular#37341
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, we would simply prepend any relative URL with the HREF
for the current route (pulled from document.location). However,
this does not correctly account for the leading slash URLs that
would otherwise be parsed correctly in the browser, or the
presence of a base HREF in the DOM.
Therefore, we use the built-in URL implementation for NodeJS,
which implements the WHATWG standard that's used in the browser.
We also pull the base HREF from the DOM, falling back on the full
HREF as the browser would, to form the correct request URL.
Fixes #37314
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: 37314
What is the new behavior?
Add support for base HREF and absolute relative URLs on SSR HTTP requests.
Does this PR introduce a breaking change?
Other information