browser(firefox): respect Set-Cookie header from fulfilled request (#5456)
This commit is contained in:
parent
9dd443e1aa
commit
822f7cb1eb
|
|
@ -1,2 +1,2 @@
|
|||
1229
|
||||
Changed: lushnikov@chromium.org Thu 11 Feb 2021 08:20:05 AM PST
|
||||
1230
|
||||
Changed: dgozman@gmail.com Sat Feb 13 10:15:07 PST 2021
|
||||
|
|
|
|||
|
|
@ -197,8 +197,13 @@ class NetworkRequest {
|
|||
// Public interception API.
|
||||
fulfill(status, statusText, headers, base64body) {
|
||||
this._interceptedChannel.synthesizeStatus(status, statusText);
|
||||
for (const header of headers)
|
||||
for (const header of headers) {
|
||||
this._interceptedChannel.synthesizeHeader(header.name, header.value);
|
||||
if (header.name.toLowerCase() === 'set-cookie') {
|
||||
Services.cookies.QueryInterface(Ci.nsICookieService);
|
||||
Services.cookies.setCookieStringFromHttp(this.httpChannel.URI, header.value, this.httpChannel);
|
||||
}
|
||||
}
|
||||
const synthesized = Cc["@mozilla.org/io/string-input-stream;1"].createInstance(Ci.nsIStringInputStream);
|
||||
const body = base64body ? atob(base64body) : '';
|
||||
synthesized.data = body;
|
||||
|
|
|
|||
Loading…
Reference in New Issue