diff options
-rw-r--r-- | ext/fetch/20_headers.js | 17 | ||||
-rw-r--r-- | tools/wpt/expectation.json | 20 |
2 files changed, 17 insertions, 20 deletions
diff --git a/ext/fetch/20_headers.js b/ext/fetch/20_headers.js index abf7433a3..bea542c30 100644 --- a/ext/fetch/20_headers.js +++ b/ext/fetch/20_headers.js @@ -308,6 +308,7 @@ class Headers { * @param {string} name */ delete(name) { + webidl.assertBranded(this, HeadersPrototype); const prefix = "Failed to execute 'delete' on 'Headers'"; webidl.requiredArguments(arguments.length, 1, prefix); name = webidl.converters["ByteString"](name, prefix, "Argument 1"); @@ -333,6 +334,7 @@ class Headers { * @param {string} name */ get(name) { + webidl.assertBranded(this, HeadersPrototype); const prefix = "Failed to execute 'get' on 'Headers'"; webidl.requiredArguments(arguments.length, 1, prefix); name = webidl.converters["ByteString"](name, prefix, "Argument 1"); @@ -345,10 +347,25 @@ class Headers { return getHeader(list, name); } + getSetCookie() { + webidl.assertBranded(this, HeadersPrototype); + const list = this[_headerList]; + + const entries = []; + for (let i = 0; i < list.length; i++) { + if (byteLowerCase(list[i][0]) === "set-cookie") { + ArrayPrototypePush(entries, list[i][1]); + } + } + + return entries; + } + /** * @param {string} name */ has(name) { + webidl.assertBranded(this, HeadersPrototype); const prefix = "Failed to execute 'has' on 'Headers'"; webidl.requiredArguments(arguments.length, 1, prefix); name = webidl.converters["ByteString"](name, prefix, "Argument 1"); diff --git a/tools/wpt/expectation.json b/tools/wpt/expectation.json index 535372179..b418608e7 100644 --- a/tools/wpt/expectation.json +++ b/tools/wpt/expectation.json @@ -4041,25 +4041,9 @@ "headers-record.any.worker.html": true, "headers-structure.any.worker.html": true, "header-setcookie.any.html": [ - "Headers.prototype.getSetCookie with no headers present", - "Headers.prototype.getSetCookie with one header", - "Headers.prototype.getSetCookie with one header created from an object", - "Headers.prototype.getSetCookie with multiple headers", - "Headers.prototype.getSetCookie with an empty header", - "Headers.prototype.getSetCookie with two equal headers", - "Headers.prototype.getSetCookie ignores set-cookie2 headers", - "Headers.prototype.getSetCookie preserves header ordering", "Set-Cookie is a forbidden response header" ], "header-setcookie.any.worker.html": [ - "Headers.prototype.getSetCookie with no headers present", - "Headers.prototype.getSetCookie with one header", - "Headers.prototype.getSetCookie with one header created from an object", - "Headers.prototype.getSetCookie with multiple headers", - "Headers.prototype.getSetCookie with an empty header", - "Headers.prototype.getSetCookie with two equal headers", - "Headers.prototype.getSetCookie ignores set-cookie2 headers", - "Headers.prototype.getSetCookie preserves header ordering", "Set-Cookie is a forbidden response header" ] }, @@ -4890,8 +4874,6 @@ ] }, "idlharness.any.html": [ - "Headers interface: operation getSetCookie()", - "Headers interface: new Headers() must inherit property \"getSetCookie()\" with the proper type", "Request interface: attribute destination", "Request interface: attribute referrer", "Request interface: attribute referrerPolicy", @@ -4923,8 +4905,6 @@ "Window interface: operation fetch(RequestInfo, optional RequestInit)" ], "idlharness.any.worker.html": [ - "Headers interface: operation getSetCookie()", - "Headers interface: new Headers() must inherit property \"getSetCookie()\" with the proper type", "Request interface: attribute destination", "Request interface: attribute referrer", "Request interface: attribute referrerPolicy", |