Skip to content
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

Content bug: Wrong header-types for Transfer-Encoding and Trailer headers #4889

Closed
singla-shivam opened this issue May 10, 2021 · 5 comments · Fixed by #4898
Closed

Content bug: Wrong header-types for Transfer-Encoding and Trailer headers #4889

singla-shivam opened this issue May 10, 2021 · 5 comments · Fixed by #4898
Assignees
Labels
Content:HTTP HTTP docs needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened.

Comments

@singla-shivam
Copy link
Contributor

What page(s) did you find the problem on?

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Trailer
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Transfer-Encoding

Specific page section or heading?

Transfer-Encoding and Trailer headers

What is the problem?

In the docs, the header type for Transfer-Encoding and Trailer headers is marked as Response header.

What did you expect to see?

They should have been marked as General header

Did you test this? If so, how?

References and research:-

@singla-shivam singla-shivam added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label May 10, 2021
@hamishwillee hamishwillee added the Content:HTTP HTTP docs label May 11, 2021
@hamishwillee
Copy link
Collaborator

hamishwillee commented May 11, 2021

Thanks @singla-shivam . I think you're definitely right, and these are not "response headers".

The definition of general headers here is "apply to both requests and responses, but with no relation to the data transmitted in the body.". Trailer fits into that category, but I'm not sure that Transfer-Encoding does, as it describes the content of the chunked payload. But then it isn't a representation/entity header either since it applies to the encoding during transport, not the final encoding.

Even if not quite right though, I think more clear to users than having "response header".

@sideshowbarker What do you think? I'm wondering if we should really use "General header" (ever) since it isn't in the spec, and instead mark things as both Request or Response header if they are both.

Specs

@sideshowbarker
Copy link
Collaborator

@sideshowbarker What do you think? I'm wondering if we should really use "General header" (ever) since it isn't in the spec

Yeah, I think we should avoid using any term that’s not used in the current HTTP spec.

and instead mark things as both Request or Response header if they are both

Yes, that seems to me like the right thing to do.

Trailer fits into that category, but I'm not sure that Transfer-Encoding does, as it describes the content of the chunked payload.

I’m not aware of browsers ever sending a Transfer-Encoding request header — but as far as for the general case in HTTP, I see the last paragraph of the https://datatracker.ietf.org/doc/html/rfc7230#section-3.3.1 section the spec says this:

A server that receives a request message with a transfer coding it does not understand SHOULD respond with 501 (Not Implemented).

That seems to imply the spec at least doesn’t rule out the possibility for transfer coding to specified in a request (and thus for a request to have a Transfer-Encoding request header — since that’s the mechanism for specifying the transfer coding).

@hamishwillee
Copy link
Collaborator

@sideshowbarker What do you think? I'm wondering if we should really use "General header" (ever) since it isn't in the spec

Yeah, I think we should avoid using any term that’s not used in the current HTTP spec.

Excellent. Given this is a change in "what we do", who should we ask for approval from? Because we should do this at least a bit "globally".

@hamishwillee
Copy link
Collaborator

@Elchi3 Chris suggest you might be a good person to advise re #4889 (comment) above. Specifically, in the HTTP Header info tables we refer to them being as request, response, general and (possibly) representation/Entity headers.

We use "General" to be mean "either request or response header based on context, unless is to do with payload representation". But the docs are specific in that they say General is not a spec term - so perhaps we should just have header type as both in a comma separated list?

E.g. like
image

@Elchi3
Copy link
Member

Elchi3 commented May 11, 2021

hm, yes, it's possible we took this definition from an older RFC (https://datatracker.ietf.org/doc/html/rfc2616#section-4.5) when we first wrote the MDN HTTP docs.

I think your suggestion to just have header types in a comma separated list makes a lot of sense. It is more clear anyways, "general" is quite generic :)

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Content:HTTP HTTP docs needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants