mirror of
https://github.com/ading2210/libcurl.js.git
synced 2025-05-13 14:30:02 -04:00
improve speeds and fix invalid mime type in blobs
This commit is contained in:
parent
0897769f70
commit
8e5a23adf2
4 changed files with 17 additions and 3 deletions
|
@ -157,6 +157,17 @@ class HTTPSession extends CurlSession {
|
|||
for (let [header_name, header_value] of response_info.headers) {
|
||||
response_obj.headers.append(header_name, header_value);
|
||||
}
|
||||
|
||||
//hack to fix invalid blob type
|
||||
let response_proto = Object.getPrototypeOf(response_obj);
|
||||
response_obj.blob = async () => {
|
||||
let blob = await response_proto.blob.call(response_obj);
|
||||
let mime_type = blob.type.split(";")[0].trim();
|
||||
Object.defineProperty(blob, "type", {
|
||||
value: mime_type
|
||||
});
|
||||
return blob;
|
||||
}
|
||||
|
||||
return response_obj;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue