@universal-middleware/express 0.4.19 → 0.4.20
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 +1 -1
- package/dist/index.js +10 -3
- package/package.json +8 -8
package/dist/index.d.ts
CHANGED
|
@@ -45,7 +45,7 @@ interface DecoratedRequest<C extends Universal.Context = Universal.Context> exte
|
|
|
45
45
|
ip?: string;
|
|
46
46
|
protocol?: string;
|
|
47
47
|
socket?: PossiblyEncryptedSocket;
|
|
48
|
-
rawBody?:
|
|
48
|
+
rawBody?: any;
|
|
49
49
|
originalUrl?: string;
|
|
50
50
|
params?: Record<string, string>;
|
|
51
51
|
[contextSymbol]?: C;
|
package/dist/index.js
CHANGED
|
@@ -22,7 +22,8 @@ function createRequestAdapter(options = {}) {
|
|
|
22
22
|
if (headers[":method"]) {
|
|
23
23
|
headers = Object.fromEntries(Object.entries(headers).filter(([key]) => !key.startsWith(":")));
|
|
24
24
|
}
|
|
25
|
-
const protocol = protocolOverride || req.protocol || trustProxy && parseForwardedHeader("proto") ||
|
|
25
|
+
const protocol = protocolOverride || req.protocol || trustProxy && parseForwardedHeader("proto") || // biome-ignore lint/suspicious/noExplicitAny: encrypted can exist in some express versions
|
|
26
|
+
req.socket?.encrypted && "https" || "http";
|
|
26
27
|
let host = hostOverride || trustProxy && parseForwardedHeader("host") || headers.host;
|
|
27
28
|
if (!host && !warned) {
|
|
28
29
|
console.warn(
|
|
@@ -35,7 +36,7 @@ function createRequestAdapter(options = {}) {
|
|
|
35
36
|
method: req.method,
|
|
36
37
|
headers,
|
|
37
38
|
body: convertBody(req),
|
|
38
|
-
// @ts-
|
|
39
|
+
// @ts-expect-error
|
|
39
40
|
duplex: "half"
|
|
40
41
|
});
|
|
41
42
|
req[requestSymbol] = request;
|
|
@@ -277,7 +278,9 @@ function setHeaders(fetchResponse, nodeResponse, mirror = false) {
|
|
|
277
278
|
nodeResponse.setHeader(key, value);
|
|
278
279
|
});
|
|
279
280
|
if (mirror) {
|
|
280
|
-
nodeResponseHeaders.forEach((key) =>
|
|
281
|
+
nodeResponseHeaders.forEach((key) => {
|
|
282
|
+
nodeResponse.removeHeader(key);
|
|
283
|
+
});
|
|
281
284
|
}
|
|
282
285
|
}
|
|
283
286
|
|
|
@@ -380,10 +383,14 @@ function getContext(req) {
|
|
|
380
383
|
function getRuntime(request, response) {
|
|
381
384
|
return getAdapterRuntime("express", {
|
|
382
385
|
params: request.params,
|
|
386
|
+
// biome-ignore lint/suspicious/noExplicitAny: cast
|
|
383
387
|
req: request,
|
|
388
|
+
// biome-ignore lint/suspicious/noExplicitAny: cast
|
|
384
389
|
res: response,
|
|
385
390
|
express: Object.freeze({
|
|
391
|
+
// biome-ignore lint/suspicious/noExplicitAny: cast
|
|
386
392
|
req: request,
|
|
393
|
+
// biome-ignore lint/suspicious/noExplicitAny: cast
|
|
387
394
|
res: response
|
|
388
395
|
})
|
|
389
396
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@universal-middleware/express",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.20",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Express adapter for universal middlewares",
|
|
6
6
|
"files": [
|
|
@@ -13,23 +13,23 @@
|
|
|
13
13
|
"repository": "https://github.com/magne4000/universal-middleware",
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@universal-middleware/core": "^0.4.
|
|
16
|
+
"@universal-middleware/core": "^0.4.13"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@swc/core": "^1.13.
|
|
19
|
+
"@swc/core": "^1.13.5",
|
|
20
20
|
"@types/express": "^5.0.3",
|
|
21
21
|
"@types/express4": "npm:@types/express@^4.17.23",
|
|
22
|
-
"@types/node": "^20.19.
|
|
22
|
+
"@types/node": "^20.19.21",
|
|
23
23
|
"express": "^5.1.0",
|
|
24
24
|
"express4": "npm:express@^4.21.2",
|
|
25
25
|
"helmet": "^8.1.0",
|
|
26
26
|
"rimraf": "^6.0.1",
|
|
27
27
|
"tsup": "^8.5.0",
|
|
28
|
-
"tsx": "^4.20.
|
|
29
|
-
"typescript": "^5.
|
|
30
|
-
"vite": "^7.
|
|
28
|
+
"tsx": "^4.20.6",
|
|
29
|
+
"typescript": "^5.9.3",
|
|
30
|
+
"vite": "^7.1.11",
|
|
31
31
|
"vitest": "^3.2.4",
|
|
32
|
-
"@universal-middleware/tests": "0.0.
|
|
32
|
+
"@universal-middleware/tests": "0.0.1"
|
|
33
33
|
},
|
|
34
34
|
"sideEffects": false,
|
|
35
35
|
"keywords": [
|