{{ message }}
Repository navigation
[Backport 20.3.X] fix(http): enable XSRF protection for same-origin absolute URLs - #71295
Merged
Merged
Conversation
TestBed on this branch provides MockPlatformLocation without a start URL, so its href is "//" and an origin check cannot parse it.
Previously, the XSRF interceptor only added the XSRF token to requests with relative URLs. This commit updates the interceptor to also add the token to requests with absolute URLs, provided they match the current origin. Fixes angular#71294 (cherry picked from commit 0659d11)
Browsers resolve these URLs to another origin, so the interceptor must not attach the XSRF token to them.
SkyZeroZx
force-pushed
the
backport-65683-to-20.3.x
branch
from
October 11, 2026 05:25
21df429 to
9b278c0
Compare
SkyZeroZx
marked this pull request as ready for review
October 11, 2026 05:25
SkyZeroZx
commented
Oct 11, 2026
JeanMeche
approved these changes
Oct 12, 2026
Member
The i18n sub-system has the `changeMask` and `changeMaskCounter` flags which are set by i18n-related instructions and reset once the state is applied. The problem is that if something throws within the application logic, the flags would never be reset. This is currently causing flakes in our CI runs. These changes resolve the issue by adding a try/finally around the flags. (cherry picked from commit 6339d26)
JeanMeche
approved these changes
Oct 13, 2026
Contributor
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Backport of #65683
Also gives the XSRF provider specs a page URL, because TestBed on 20.3.x provides
MockPlatformLocationwithout a start URL, and adds specs for backslash and whitespace URLs.Fixes #71294