@comunica/actor-http-fetch
Advanced tools
Comparing version 2.10.0 to 2.10.1
@@ -19,6 +19,16 @@ "use strict"; | ||
// Convert body Web stream to Node stream, as node-fetch does not support Web streams | ||
let halfDuplex = false; | ||
if (init.body && typeof init.body !== 'string' && 'getReader' in init.body) { | ||
init.body = bus_http_1.ActorHttp.toNodeReadable(init.body); | ||
// The Fetch API requires specific options to be set when sending body streams: | ||
// - 'keepalive' can not be true | ||
// - 'duplex' must be set to 'half' | ||
halfDuplex = true; | ||
} | ||
return { ...init, agent: this.agent, keepalive: true }; | ||
return { | ||
...init, | ||
agent: this.agent, | ||
keepalive: !halfDuplex ? true : undefined, | ||
duplex: halfDuplex ? 'half' : undefined, | ||
}; | ||
} | ||
@@ -25,0 +35,0 @@ async createAbortController() { |
{ | ||
"name": "@comunica/actor-http-fetch", | ||
"version": "2.10.0", | ||
"version": "2.10.1", | ||
"description": "A node-fetch http actor", | ||
@@ -47,3 +47,3 @@ "lsd:module": true, | ||
}, | ||
"gitHead": "4d8603ca7e7606ca8eaef305e8753b3f91668f4e" | ||
"gitHead": "4d0383bd0f7cef463daf7044e9add498f8c67797" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
48831
329