Implement Headers.prototype.getSetCookie

This commit is contained in:
2shiori17 2023-03-05 00:52:19 +09:00
parent 9f98a1ed1a
commit 4ee3f575f6
3 changed files with 11 additions and 36 deletions

View file

@ -155,6 +155,16 @@ impl HeadersMethods for Headers {
.map(|v| ByteString::new(v.as_bytes().to_vec())))
}
// https://fetch.spec.whatwg.org/#dom-headers-getsetcookie
fn GetSetCookie(&self) -> Vec<ByteString> {
self.header_list
.borrow()
.get_all("Set-Cookie")
.iter()
.map(|v| ByteString::new(v.as_bytes().to_vec()))
.collect()
}
// https://fetch.spec.whatwg.org/#dom-headers-has
fn Has(&self, name: ByteString) -> Fallible<bool> {
// Step 1