-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
feat(extensions/fetch): Add Origin header to outgoing requests for fetch #11557
Conversation
0cb7110
to
5663b6c
Compare
5663b6c
to
1227be8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@F3n67u Thanks for the patch. LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the spec again, I am unsure about adding the header now. It is meant for CORS and doesn't really make much sense other than spec compliance.
const baseURL = getLocationHref(); | ||
if ( | ||
baseURL && | ||
(requestObject.method !== "GET" && requestObject.method !== "HEAD") | ||
) { | ||
ArrayPrototypePush(request.headerList, [ | ||
"origin", | ||
new URL(baseURL).origin, | ||
]); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not correct. The header should be added of a different function in the implementation. The spec explains this.
The origin header should also respect request referrer policy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, take a look at where it is called.
… for fetch (denoland#11557)" This reverts commit f87aa44.
Is there any use case where |
fix #10992