@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.
Files changed (2) hide show
  1. package/dist/index.js +5 -1
  2. 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: Object.fromEntries(request.headers),
321
+ headers,
318
322
  socket: { encrypted: url.protocol === "https:" }
319
323
  });
320
324
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@universal-middleware/express",
3
- "version": "0.4.29",
3
+ "version": "0.4.30",
4
4
  "type": "module",
5
5
  "description": "Express adapter for universal middlewares",
6
6
  "files": [