Fix cookies

The set-cookie header was flattened, preventing cookies from being set

The way headers were being read from the BareResponseFetch API meant they were headers that were already flattened (new Headers())

This is fix makes the headers identical to earlier UV versions
This commit is contained in:
David Reed 2022-11-26 16:30:52 -05:00
parent 7b53361367
commit 82d50484e6
No known key found for this signature in database
GPG key ID: 2211691D8A1EE72F

View file

@ -264,7 +264,10 @@ class ResponseContext {
this.request = request;
this.raw = response;
this.ultraviolet = request.ultraviolet;
this.headers = Object.fromEntries(response.headers.entries());
this.headers = {};
// eg set-cookie
for (const key in response.rawHeaders)
this.headers[key.toLowerCase()] = response.rawHeaders[key];
this.status = response.status;
this.statusText = response.statusText;
this.body = response.body;