@universal-middleware/express 0.2.2 → 0.2.3

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.d.ts CHANGED
@@ -44,6 +44,7 @@ interface DecoratedRequest<C extends Universal.Context = Universal.Context> exte
44
44
  protocol?: string;
45
45
  socket?: PossiblyEncryptedSocket;
46
46
  rawBody?: Buffer | null;
47
+ originalUrl?: string;
47
48
  [contextSymbol]?: C;
48
49
  [requestSymbol]?: Request;
49
50
  }
package/dist/index.js CHANGED
@@ -30,13 +30,16 @@ function createRequestAdapter(options = {}) {
30
30
  warned = true;
31
31
  host = "localhost";
32
32
  }
33
- const request = new Request(protocol + "://" + host + req.url, {
34
- method: req.method,
35
- headers,
36
- body: convertBody(req),
37
- // @ts-ignore
38
- duplex: "half"
39
- });
33
+ const request = new Request(
34
+ protocol + "://" + host + (req.originalUrl ?? req.url),
35
+ {
36
+ method: req.method,
37
+ headers,
38
+ body: convertBody(req),
39
+ // @ts-ignore
40
+ duplex: "half"
41
+ }
42
+ );
40
43
  req[requestSymbol] = request;
41
44
  return request;
42
45
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@universal-middleware/express",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "type": "module",
5
5
  "description": "Express adapter for universal middlewares",
6
6
  "files": [
@@ -26,7 +26,7 @@
26
26
  "release:commit": "LANG=en_US release-me commit"
27
27
  },
28
28
  "dependencies": {
29
- "@universal-middleware/core": "^0.2.4"
29
+ "@universal-middleware/core": "^0.2.6"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@brillout/release-me": "^0.4.0",
@@ -37,7 +37,7 @@
37
37
  "helmet": "^7.1.0",
38
38
  "rimraf": "^6.0.0",
39
39
  "tsup": "^8.2.4",
40
- "tsx": "^4.17.0",
40
+ "tsx": "^4.19.0",
41
41
  "typescript": "^5.5.4",
42
42
  "vitest": "^2.0.5"
43
43
  },