fetch icon indicating copy to clipboard operation
fetch copied to clipboard

Modify httpRequest’s header list per HTTP.

Open ronag opened this issue 2 years ago • 11 comments

https://fetch.spec.whatwg.org/#http-network-or-cache-fetch 18

Modify httpRequest’s header list per HTTP.

It is unclear what "list per HTTP" means?

ronag avatar Aug 10 '21 06:08 ronag

The full step has a bit more detail about what this means, but I suppose that could be made a tad more explicit.

annevk avatar Aug 10 '21 11:08 annevk

The full step has a bit more detail about what this means

Sorry, where is that?

ronag avatar Aug 10 '21 13:08 ronag

Step 18 reads as follows:

Modify httpRequest’s header list per HTTP. Do not append a given header if httpRequest’s header list contains that header’s name.

Note: It would be great if we could make this more normative somehow. At this point headers such as Accept-Encoding, Connection, DNT, and Host, are to be appended if necessary.

Accept, Accept-Charset, and Accept-Language must not be included at this point.

Note: Accept and Accept-Language are already included (unless fetch() is used, which does not include the latter by default), and Accept-Charset is a waste of bytes. See HTTP header layer division for more details.

annevk avatar Aug 10 '21 14:08 annevk

That's a little hard to follow IMHO.

"such as" "if necessary" "must not be included " but then says "which does not include the latter by default"

ronag avatar Aug 10 '21 14:08 ronag

Agreed, it's just somewhat tricky to make this more concrete as it's not clear how to interface with the HTTP specification. But we could probably make that somewhat clearer as a start.

annevk avatar Aug 10 '21 15:08 annevk

Can we add a link to the corresponding sections in the HTTP spec?

ronag avatar Aug 10 '21 17:08 ronag

Wait a few weeks; the HTTP specs are about to be revised as new RFCs.

mnot avatar Aug 10 '21 23:08 mnot

So the relevant spec is not available?

ronag avatar Aug 11 '21 05:08 ronag

They are, but they are getting a rather significant revision and if we are going to link to anything it would be better to link to that.

annevk avatar Aug 11 '21 07:08 annevk

They are, but they are getting a rather significant revision and if we are going to link to anything it would be better to link to that.

I see. Could you maybe provide the links here in the issue? So that I can at least figure out what the current revision says.

And maybe where/how we can get notified about the new revisions?

ronag avatar Aug 11 '21 07:08 ronag

https://datatracker.ietf.org/doc/html/rfc7230 and https://httpwg.org/http-core/draft-ietf-httpbis-semantics-latest.html are relevant. DNT is defined in https://www.w3.org/TR/tracking-dnt/ and might go away at some point I suppose as it's bee rather useless. And as mentioned in the note being more exhaustive here would be great, but that would require some amount of research into what implementations are doing and how that can be best written down.

annevk avatar Aug 11 '21 07:08 annevk