fetch: send 'sec-purpose' header for prefetch requests#3694
Closed
trivikr wants to merge 3 commits into
Closed
Conversation
mcollina
requested changes
Oct 7, 2024
mcollina
left a comment
Member
There was a problem hiding this comment.
Can you add a test or enable one in the wpts?
Member
|
There are no viable WPTs for server implementations |
Contributor
|
@trivikr |
Uzlopak
reviewed
Oct 7, 2024
Uzlopak
reviewed
Oct 7, 2024
|
|
||
| // 4. Set request to a new request whose URL is parsedURL. | ||
| request = makeRequest({ urlList: [parsedURL] }) | ||
| request = makeRequest({ urlList: [parsedURL], ...init }) |
trivikr
commented
Oct 7, 2024
Co-authored-by: Trivikram Kamat <16024985+trivikr@users.noreply.github.com>
KhafraDev
requested changes
Oct 8, 2024
KhafraDev
left a comment
Member
There was a problem hiding this comment.
request.initiator will always be null therefore sec-purpose will never be added. It's fine to have the condition that adds it in case the spec ever changes, but most of the other stuff should be removed.
Comment on lines
+1063
to
+1068
| { | ||
| key: 'initiator', | ||
| converter: webidl.converters.DOMString, | ||
| // https://fetch.spec.whatwg.org/#concept-request-initiator | ||
| allowedValues: requestInitiator | ||
| }, |
Member
There was a problem hiding this comment.
This is wrong. A Request's request (internal state) contains an initiator, not RequestInit
|
|
||
| // 4. Set request to a new request whose URL is parsedURL. | ||
| request = makeRequest({ urlList: [parsedURL] }) | ||
| request = makeRequest({ urlList: [parsedURL], ...init }) |
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.
This relates to...
Step 14 in WHATWG fetch specification https://fetch.spec.whatwg.org/#http-network-or-cache-fetch, added in whatwg/fetch#1576
Changes
Sends 'sec-purpose' header for prefetch requests as per WHATWG fetch specification
Features
N/A
Bug Fixes
N/A
Breaking Changes and Deprecations
N/A
Status