@fedify/elysia 2.5.0-dev.2619 → 2.5.0-dev.2687
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.cjs +2 -4
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -4
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -30,9 +30,7 @@ const fedify = (federation, contextDataFactory) => {
|
|
|
30
30
|
if (!notFound && !notAcceptable) {
|
|
31
31
|
set.status = response.status;
|
|
32
32
|
if (response.body) return response;
|
|
33
|
-
response.headers.
|
|
34
|
-
set.headers[key] = value;
|
|
35
|
-
});
|
|
33
|
+
for (const [key, value] of response.headers) set.headers[key] = value;
|
|
36
34
|
return new Response(null, { status: response.status });
|
|
37
35
|
}
|
|
38
36
|
}).onTransform(({ request }) => {
|
|
@@ -64,7 +62,7 @@ const fedify = (federation, contextDataFactory) => {
|
|
|
64
62
|
"transfer-encoding"
|
|
65
63
|
].includes(name)) delete set.headers[header];
|
|
66
64
|
}
|
|
67
|
-
const fields = vary.
|
|
65
|
+
const fields = vary.flatMap((field) => field.trim() ? [field.trim()] : []);
|
|
68
66
|
if (!fields.some((field) => field === "*" || field.toLowerCase() === "accept")) fields.push("Accept");
|
|
69
67
|
set.status = 406;
|
|
70
68
|
return new Response("Not acceptable", {
|
package/dist/index.d.cts
CHANGED
|
@@ -3,6 +3,6 @@ import { AnyElysia } from "elysia";
|
|
|
3
3
|
|
|
4
4
|
//#region src/index.d.ts
|
|
5
5
|
type ContextDataFactory<TContextData> = (req?: Request) => TContextData | Promise<TContextData>;
|
|
6
|
-
declare const fedify: <TContextData = unknown>(federation: Federation<TContextData>, contextDataFactory: ContextDataFactory<TContextData>) => (app: AnyElysia) => AnyElysia;
|
|
6
|
+
declare const fedify: <TContextData = unknown>(federation: Federation<TContextData>, contextDataFactory: ContextDataFactory<TContextData>) => ((app: AnyElysia) => AnyElysia);
|
|
7
7
|
//#endregion
|
|
8
8
|
export { ContextDataFactory, fedify };
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,6 @@ import { AnyElysia } from "elysia";
|
|
|
3
3
|
|
|
4
4
|
//#region src/index.d.ts
|
|
5
5
|
type ContextDataFactory<TContextData> = (req?: Request) => TContextData | Promise<TContextData>;
|
|
6
|
-
declare const fedify: <TContextData = unknown>(federation: Federation<TContextData>, contextDataFactory: ContextDataFactory<TContextData>) => (app: AnyElysia) => AnyElysia;
|
|
6
|
+
declare const fedify: <TContextData = unknown>(federation: Federation<TContextData>, contextDataFactory: ContextDataFactory<TContextData>) => ((app: AnyElysia) => AnyElysia);
|
|
7
7
|
//#endregion
|
|
8
8
|
export { ContextDataFactory, fedify };
|
package/dist/index.js
CHANGED
|
@@ -29,9 +29,7 @@ const fedify = (federation, contextDataFactory) => {
|
|
|
29
29
|
if (!notFound && !notAcceptable) {
|
|
30
30
|
set.status = response.status;
|
|
31
31
|
if (response.body) return response;
|
|
32
|
-
response.headers.
|
|
33
|
-
set.headers[key] = value;
|
|
34
|
-
});
|
|
32
|
+
for (const [key, value] of response.headers) set.headers[key] = value;
|
|
35
33
|
return new Response(null, { status: response.status });
|
|
36
34
|
}
|
|
37
35
|
}).onTransform(({ request }) => {
|
|
@@ -63,7 +61,7 @@ const fedify = (federation, contextDataFactory) => {
|
|
|
63
61
|
"transfer-encoding"
|
|
64
62
|
].includes(name)) delete set.headers[header];
|
|
65
63
|
}
|
|
66
|
-
const fields = vary.
|
|
64
|
+
const fields = vary.flatMap((field) => field.trim() ? [field.trim()] : []);
|
|
67
65
|
if (!fields.some((field) => field === "*" || field.toLowerCase() === "accept")) fields.push("Accept");
|
|
68
66
|
set.status = 406;
|
|
69
67
|
return new Response("Not acceptable", {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fedify/elysia",
|
|
3
|
-
"version": "2.5.0-dev.
|
|
3
|
+
"version": "2.5.0-dev.2687+924da5ce",
|
|
4
4
|
"description": "Integrate Fedify with Elysia",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Fedify",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
],
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"elysia": "^1.3.6",
|
|
47
|
-
"@fedify/fedify": "^2.5.0-dev.
|
|
47
|
+
"@fedify/fedify": "^2.5.0-dev.2687+924da5ce"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"bun-types": "^1.2.19",
|