@universal-middleware/express 0.4.29 → 0.4.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +5 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -311,10 +311,14 @@ function connectToWeb(handler) {
|
|
|
311
311
|
function createIncomingMessage(request) {
|
|
312
312
|
const url = new URL(request.url, "http://localhost");
|
|
313
313
|
const body = request.body ? Readable.fromWeb(request.body) : Readable.from([]);
|
|
314
|
+
const headers = Object.fromEntries(request.headers);
|
|
315
|
+
if (request.body && headers["content-length"] === void 0) {
|
|
316
|
+
headers["transfer-encoding"] = "chunked";
|
|
317
|
+
}
|
|
314
318
|
return Object.assign(body, {
|
|
315
319
|
url: url.pathname + url.search,
|
|
316
320
|
method: request.method,
|
|
317
|
-
headers
|
|
321
|
+
headers,
|
|
318
322
|
socket: { encrypted: url.protocol === "https:" }
|
|
319
323
|
});
|
|
320
324
|
}
|