mirror of
https://github.com/MercuryWorkshop/bare-mux.git
synced 2025-05-14 06:40:02 -04:00
add rawresponse and finalurl to blob: urls
This commit is contained in:
parent
c56d2862a1
commit
c2a333e3df
1 changed files with 9 additions and 2 deletions
|
@ -173,13 +173,20 @@ export class BareClient {
|
|||
|
||||
if (urlO.protocol.startsWith('blob:')) {
|
||||
const response = await nativeFetch(urlO);
|
||||
const result: Response & Partial<BareResponse> = new Response(
|
||||
const result: Response & Partial<BareResponseFetch> = new Response(
|
||||
response.body,
|
||||
response
|
||||
);
|
||||
|
||||
result.rawHeaders = Object.fromEntries(response.headers as any);
|
||||
|
||||
result.rawResponse = {
|
||||
body: response.body,
|
||||
headers: Object.fromEntries(response.headers as any),
|
||||
status: response.status,
|
||||
statusText: response.statusText,
|
||||
};
|
||||
result.finalURL = urlO.toString();
|
||||
|
||||
return result as BareResponseFetch;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue