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

fix: implement Headers#delete correctly #2430

Merged
merged 5 commits into from
Nov 14, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 2 additions & 6 deletions lib/fetch/headers.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ class HeadersList {
this.cookies = null
}

return this[kHeadersMap].delete(name)
this[kHeadersMap].delete(name)
}

// https://fetch.spec.whatwg.org/#concept-header-list-get
Expand Down Expand Up @@ -301,14 +301,10 @@ class Headers {

// 6. If this’s header list does not contain name, then
// return.
if (!this[kHeadersList].contains(name)) {
return
}

tsctx marked this conversation as resolved.
Show resolved Hide resolved
// 7. Delete name from this’s header list.
// 8. If this’s guard is "request-no-cors", then remove
// privileged no-CORS request headers from this.
return this[kHeadersList].delete(name)
this[kHeadersList].delete(name)
}

// https://fetch.spec.whatwg.org/#dom-headers-get
Expand Down