Skip to content

Commit 822f7cb

Browse files
authored
browser(firefox): respect Set-Cookie header from fulfilled request (#5456)
1 parent 9dd443e commit 822f7cb

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

browser_patches/firefox/BUILD_NUMBER

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
1229
2-
Changed: [email protected] Thu 11 Feb 2021 08:20:05 AM PST
1+
1230
2+
Changed: [email protected] Sat Feb 13 10:15:07 PST 2021

browser_patches/firefox/juggler/NetworkObserver.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,13 @@ class NetworkRequest {
197197
// Public interception API.
198198
fulfill(status, statusText, headers, base64body) {
199199
this._interceptedChannel.synthesizeStatus(status, statusText);
200-
for (const header of headers)
200+
for (const header of headers) {
201201
this._interceptedChannel.synthesizeHeader(header.name, header.value);
202+
if (header.name.toLowerCase() === 'set-cookie') {
203+
Services.cookies.QueryInterface(Ci.nsICookieService);
204+
Services.cookies.setCookieStringFromHttp(this.httpChannel.URI, header.value, this.httpChannel);
205+
}
206+
}
202207
const synthesized = Cc["@mozilla.org/io/string-input-stream;1"].createInstance(Ci.nsIStringInputStream);
203208
const body = base64body ? atob(base64body) : '';
204209
synthesized.data = body;

0 commit comments

Comments
 (0)