fetch: header tweaks to improve compliance with fetch spec (#33562)

* fetch: various header tweaks to improve compliance with fetch spec

Signed-off-by: Shane Handley <shanehandley@fastmail.com>

* fix: simplify the authorization header removal

Signed-off-by: Shane Handley <shanehandley@fastmail.com>

---------

Signed-off-by: Shane Handley <shanehandley@fastmail.com>
This commit is contained in:
shanehandley 2024-09-28 02:05:55 +10:00 committed by GitHub
parent f96a62f0ce
commit c7ef974968
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 21 additions and 61 deletions

View file

@ -267,7 +267,7 @@ impl Response {
ResponseType::Cors => {
let headers = old_headers.iter().filter(|(name, _)| {
match &*name.as_str().to_ascii_lowercase() {
"cache-control" | "content-language" | "content-type" |
"cache-control" | "content-language" | "content-length" | "content-type" |
"expires" | "last-modified" | "pragma" => true,
"set-cookie" | "set-cookie2" => false,
header => {