http-extensions
http-extensions copied to clipboard
Retrofit: X-Content-Type-Options is a list, not an item
Reason:
- The standard for X-Content-Type-Options is specified in the Fetch Standard, which treats it as a list (currently with only one valid option).
https://fetch.spec.whatwg.org/#x-content-type-options-header
To determine nosniff, given a header list list, run these steps:
- Let values be the result of getting, decoding, and splitting
[X-Content-Type-Options](https://fetch.spec.whatwg.org/#http-x-content-type-options)from list.- If values is null, then return false.
- If values[0] is an ASCII case-insensitive match for "nosniff", then return true.
- Return false.
- Some websites, such as IANA, use multiple X-Content-Type-Options headers. Example:
$ curl -si https://www.iana.org/help/example-domains | grep -i x-content
X-Content-Type-Options: nosniff
X-Content-Type-Options: nosniff
- The field name is X-Content-Type-Options, not X-Content-Type-Option, implying that there is a possibility of adding more options to this field in the future.
Thanks,