@@ -112,3 +112,5 @@ // src/adapter/aws-lambda/handler.ts | ||
| if (event.body) { | ||
| requestInit.body = event.isBase64Encoded ? decodeBase64(event.body) : event.body; | ||
| const body = event.isBase64Encoded ? decodeBase64(event.body) : new TextEncoder().encode(event.body); | ||
| requestInit.body = body; | ||
| headers.set("content-length", body.length.toString()); | ||
| } | ||
@@ -285,3 +287,3 @@ return new Request(url, requestInit); | ||
| } else { | ||
| result.headers["set-cookie"] = cookies.join(", "); | ||
| result.headers["set-cookie"] = cookies[0]; | ||
| } | ||
@@ -321,3 +323,3 @@ } | ||
| ...result.headers, | ||
| "set-cookie": cookies.join(", ") | ||
| "set-cookie": cookies | ||
| }; | ||
@@ -324,0 +326,0 @@ } |
@@ -48,7 +48,13 @@ // src/adapter/lambda-edge/handler.ts | ||
| Object.entries(event.Records[0].cf.request.headers).forEach(([k, v]) => { | ||
| v.forEach((header) => headers.set(k, header.value)); | ||
| v.forEach((header) => headers.append(k, header.value)); | ||
| }); | ||
| const requestBody = event.Records[0].cf.request.body; | ||
| const method = event.Records[0].cf.request.method; | ||
| const body = createBody(method, requestBody); | ||
| const rawBody = createBody(method, requestBody); | ||
| let body = rawBody; | ||
| if (rawBody !== void 0) { | ||
| const bytes = typeof rawBody === "string" ? new TextEncoder().encode(rawBody) : rawBody; | ||
| body = bytes; | ||
| headers.set("content-length", bytes.length.toString()); | ||
| } | ||
| return new Request(url, { | ||
@@ -55,0 +61,0 @@ headers, |
@@ -142,3 +142,5 @@ var __defProp = Object.defineProperty; | ||
| if (event.body) { | ||
| requestInit.body = event.isBase64Encoded ? (0, import_encode.decodeBase64)(event.body) : event.body; | ||
| const body = event.isBase64Encoded ? (0, import_encode.decodeBase64)(event.body) : new TextEncoder().encode(event.body); | ||
| requestInit.body = body; | ||
| headers.set("content-length", body.length.toString()); | ||
| } | ||
@@ -315,3 +317,3 @@ return new Request(url, requestInit); | ||
| } else { | ||
| result.headers["set-cookie"] = cookies.join(", "); | ||
| result.headers["set-cookie"] = cookies[0]; | ||
| } | ||
@@ -351,3 +353,3 @@ } | ||
| ...result.headers, | ||
| "set-cookie": cookies.join(", ") | ||
| "set-cookie": cookies | ||
| }; | ||
@@ -354,0 +356,0 @@ } |
@@ -81,7 +81,13 @@ var __create = Object.create; | ||
| Object.entries(event.Records[0].cf.request.headers).forEach(([k, v]) => { | ||
| v.forEach((header) => headers.set(k, header.value)); | ||
| v.forEach((header) => headers.append(k, header.value)); | ||
| }); | ||
| const requestBody = event.Records[0].cf.request.body; | ||
| const method = event.Records[0].cf.request.method; | ||
| const body = createBody(method, requestBody); | ||
| const rawBody = createBody(method, requestBody); | ||
| let body = rawBody; | ||
| if (rawBody !== void 0) { | ||
| const bytes = typeof rawBody === "string" ? new TextEncoder().encode(rawBody) : rawBody; | ||
| body = bytes; | ||
| headers.set("content-length", bytes.length.toString()); | ||
| } | ||
| return new Request(url, { | ||
@@ -88,0 +94,0 @@ headers, |
@@ -34,5 +34,2 @@ var __defProp = Object.defineProperty; | ||
| if (optsOrigin === "*") { | ||
| if (opts.credentials) { | ||
| return (origin) => origin || null; | ||
| } | ||
| return () => optsOrigin; | ||
@@ -72,3 +69,3 @@ } else { | ||
| if (c.req.method === "OPTIONS") { | ||
| if (opts.origin !== "*" || opts.credentials) { | ||
| if (opts.origin !== "*") { | ||
| set("Vary", "Origin"); | ||
@@ -103,3 +100,3 @@ } | ||
| await next(); | ||
| if (opts.origin !== "*" || opts.credentials) { | ||
| if (opts.origin !== "*") { | ||
| c.header("Vary", "Origin", { append: true }); | ||
@@ -106,0 +103,0 @@ } |
@@ -48,3 +48,3 @@ var __defProp = Object.defineProperty; | ||
| filename = (0, import_url.tryDecodeURI)(c.req.path); | ||
| if (/(?:^|[\/\\])\.{1,2}(?:$|[\/\\])|[\/\\]{2,}/.test(filename)) { | ||
| if (/(?:^|[\/\\])\.{1,2}(?:$|[\/\\])|[\/\\]{2,}|\\/.test(filename)) { | ||
| throw new Error(); | ||
@@ -51,0 +51,0 @@ } |
@@ -13,5 +13,2 @@ // src/middleware/cors/index.ts | ||
| if (optsOrigin === "*") { | ||
| if (opts.credentials) { | ||
| return (origin) => origin || null; | ||
| } | ||
| return () => optsOrigin; | ||
@@ -51,3 +48,3 @@ } else { | ||
| if (c.req.method === "OPTIONS") { | ||
| if (opts.origin !== "*" || opts.credentials) { | ||
| if (opts.origin !== "*") { | ||
| set("Vary", "Origin"); | ||
@@ -82,3 +79,3 @@ } | ||
| await next(); | ||
| if (opts.origin !== "*" || opts.credentials) { | ||
| if (opts.origin !== "*") { | ||
| c.header("Vary", "Origin", { append: true }); | ||
@@ -85,0 +82,0 @@ } |
@@ -27,3 +27,3 @@ // src/middleware/serve-static/index.ts | ||
| filename = tryDecodeURI(c.req.path); | ||
| if (/(?:^|[\/\\])\.{1,2}(?:$|[\/\\])|[\/\\]{2,}/.test(filename)) { | ||
| if (/(?:^|[\/\\])\.{1,2}(?:$|[\/\\])|[\/\\]{2,}|\\/.test(filename)) { | ||
| throw new Error(); | ||
@@ -30,0 +30,0 @@ } |
@@ -69,3 +69,3 @@ import type { Hono } from '../../hono'; | ||
| type WithHeaders = { | ||
| headers: Record<string, string>; | ||
| headers: Record<string, string | string[]>; | ||
| multiValueHeaders?: undefined; | ||
@@ -72,0 +72,0 @@ }; |
+1
-1
| { | ||
| "name": "hono", | ||
| "version": "4.12.24", | ||
| "version": "4.12.25", | ||
| "description": "Web framework built on Web Standards", | ||
@@ -5,0 +5,0 @@ "main": "dist/cjs/index.js", |
Sorry, the diff of this file is not supported yet
1416507
0.03%37221
0.03%