mirror of
https://github.com/servo/servo.git
synced 2025-08-02 04:00:32 +01:00
Implement Headers.prototype.getSetCookie
This commit is contained in:
parent
9f98a1ed1a
commit
4ee3f575f6
3 changed files with 11 additions and 36 deletions
|
@ -155,6 +155,16 @@ impl HeadersMethods for Headers {
|
||||||
.map(|v| ByteString::new(v.as_bytes().to_vec())))
|
.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
|
// https://fetch.spec.whatwg.org/#dom-headers-has
|
||||||
fn Has(&self, name: ByteString) -> Fallible<bool> {
|
fn Has(&self, name: ByteString) -> Fallible<bool> {
|
||||||
// Step 1
|
// Step 1
|
||||||
|
|
|
@ -15,6 +15,7 @@ interface Headers {
|
||||||
undefined delete(ByteString name);
|
undefined delete(ByteString name);
|
||||||
[Throws]
|
[Throws]
|
||||||
ByteString? get(ByteString name);
|
ByteString? get(ByteString name);
|
||||||
|
sequence<ByteString> getSetCookie();
|
||||||
[Throws]
|
[Throws]
|
||||||
boolean has(ByteString name);
|
boolean has(ByteString name);
|
||||||
[Throws]
|
[Throws]
|
||||||
|
|
|
@ -23,33 +23,15 @@
|
||||||
[Headers.prototype.append works for set-cookie]
|
[Headers.prototype.append works for set-cookie]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[Headers.prototype.getSetCookie with no headers present]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Headers.prototype.getSetCookie with one header]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Headers.prototype.getSetCookie with one header created from an object]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Headers.prototype.getSetCookie with multiple headers]
|
[Headers.prototype.getSetCookie with multiple headers]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[Headers.prototype.getSetCookie with an empty header]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Headers.prototype.getSetCookie with two equal headers]
|
[Headers.prototype.getSetCookie with two equal headers]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[Headers.prototype.getSetCookie ignores set-cookie2 headers]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Headers.prototype.getSetCookie preserves header ordering]
|
[Headers.prototype.getSetCookie preserves header ordering]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[Set-Cookie is a forbidden response header]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Headers iterator is correctly updated with set-cookie changes #2]
|
[Headers iterator is correctly updated with set-cookie changes #2]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
@ -79,33 +61,15 @@
|
||||||
[Headers.prototype.append works for set-cookie]
|
[Headers.prototype.append works for set-cookie]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[Headers.prototype.getSetCookie with no headers present]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Headers.prototype.getSetCookie with one header]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Headers.prototype.getSetCookie with one header created from an object]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Headers.prototype.getSetCookie with multiple headers]
|
[Headers.prototype.getSetCookie with multiple headers]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[Headers.prototype.getSetCookie with an empty header]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Headers.prototype.getSetCookie with two equal headers]
|
[Headers.prototype.getSetCookie with two equal headers]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[Headers.prototype.getSetCookie ignores set-cookie2 headers]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Headers.prototype.getSetCookie preserves header ordering]
|
[Headers.prototype.getSetCookie preserves header ordering]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[Set-Cookie is a forbidden response header]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Headers iterator is correctly updated with set-cookie changes #2]
|
[Headers iterator is correctly updated with set-cookie changes #2]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue