mdn / content

The content behind MDN Web Docs
https://developer.mozilla.org
Other
9.17k stars 22.46k forks source link

Content-Length is not documented as a CORS-safelisted header #36455

Open osher opened 3 hours ago

osher commented 3 hours ago

MDN URL

https://developer.mozilla.org/en-US/docs/Glossary/CORS-safelisted_request_header

What specific section or headline is this issue about?

CORS-safelisted request header

What information was incorrect, unhelpful, or incomplete?

It does not list the Content-Length header

What did you expect to see?

Content-Length to at least be mentioned

Do you have any supporting links, references, or citations?

I found this issue that sais that Content-Length was accepted as a safe-cors header: https://github.com/mdn/content/issues/2503

Do you have anything more you want to share?

I know Content-Length is set automatically, but it's an essential part of the protocol and it is safe-listed - I believe it should at least be mentioned...

osher commented 3 hours ago

๐Ÿค” since this header is being usually set automatically and is not provided by the user-code,

Alternatively - the page can clarify it lists only headers that can be provided by the user-code, ๐Ÿคจ but that will raise questions that will be answered by giving content-length as an example... ๐Ÿ˜›

P.S: Although cors is a browser thing, keep a point-of-view that does not take browser as a given. I got to this page from exploring fetch for a sever code.