@farcaster/snap-hono 1.5.3 → 1.5.5
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 +2 -2
- package/src/index.ts +6 -1
package/dist/index.js
CHANGED
|
@@ -214,7 +214,11 @@ function snapOriginFromRequest(request) {
|
|
|
214
214
|
return fromEnv.replace(/\/$/, "");
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
|
-
|
|
217
|
+
const url = new URL(request.url);
|
|
218
|
+
const proto = request.headers.get("x-forwarded-proto") ??
|
|
219
|
+
url.protocol.replace(":", "");
|
|
220
|
+
const host = request.headers.get("x-forwarded-host") ?? url.host;
|
|
221
|
+
return `${proto}://${host}`;
|
|
218
222
|
}
|
|
219
223
|
function clientWantsSnapResponse(accept) {
|
|
220
224
|
if (!accept || accept.trim() === "")
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@farcaster/snap-hono",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.5",
|
|
4
4
|
"description": "Hono integration for Farcaster Snap servers",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@resvg/resvg-wasm": "^2.6.2",
|
|
30
30
|
"satori": "^0.10.0",
|
|
31
|
-
"@farcaster/snap": "1.
|
|
31
|
+
"@farcaster/snap": "1.17.1"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"hono": ">=4.0.0"
|
package/src/index.ts
CHANGED
|
@@ -313,7 +313,12 @@ function snapOriginFromRequest(request: Request): string {
|
|
|
313
313
|
}
|
|
314
314
|
}
|
|
315
315
|
|
|
316
|
-
|
|
316
|
+
const url = new URL(request.url);
|
|
317
|
+
const proto =
|
|
318
|
+
request.headers.get("x-forwarded-proto") ??
|
|
319
|
+
url.protocol.replace(":", "");
|
|
320
|
+
const host = request.headers.get("x-forwarded-host") ?? url.host;
|
|
321
|
+
return `${proto}://${host}`;
|
|
317
322
|
}
|
|
318
323
|
|
|
319
324
|
function clientWantsSnapResponse(accept: string | undefined): boolean {
|