@@ -39,3 +39,3 @@ var __defProp = Object.defineProperty; | ||
| for (const [k, v] of Object.entries(params)) { | ||
| const reg = new RegExp("/:" + k + "(?:{[^/]+})?\\??"); | ||
| const reg = new RegExp("/:" + k + "(?:{[^/]+})?\\??(?=/|$)"); | ||
| urlString = urlString.replace(reg, v ? `/${v}` : ""); | ||
@@ -42,0 +42,0 @@ } |
@@ -58,3 +58,3 @@ var __defProp = Object.defineProperty; | ||
| if (cacheControlDirectives) { | ||
| const existingDirectives = c.res.headers.get("Cache-Control")?.split(",").map((d) => d.trim().split("=", 1)[0]) ?? []; | ||
| const existingDirectives = c.res.headers.get("Cache-Control")?.split(",").map((d) => d.trim().split("=", 1)[0].toLowerCase()) ?? []; | ||
| for (const directive of cacheControlDirectives) { | ||
@@ -61,0 +61,0 @@ let [name, value] = directive.trim().split("=", 2); |
@@ -60,3 +60,4 @@ var __defProp = Object.defineProperty; | ||
| const contentLength = ctx.res.headers.get("Content-Length"); | ||
| if (ctx.res.headers.has("Content-Encoding") || // already encoded | ||
| if (ctx.res.status === 206 || // partial content, Content-Range refers to the uncompressed bytes | ||
| ctx.res.headers.has("Content-Encoding") || // already encoded | ||
| ctx.res.headers.has("Transfer-Encoding") || // already encoded or chunked | ||
@@ -63,0 +64,0 @@ ctx.req.method === "HEAD" || // HEAD request |
@@ -83,7 +83,9 @@ var __defProp = Object.defineProperty; | ||
| url.searchParams.delete(queryName); | ||
| const request = new Request(url.toString(), { | ||
| const requestInit = { | ||
| body: c.req.raw.body, | ||
| headers: c.req.raw.headers, | ||
| method | ||
| }); | ||
| method, | ||
| duplex: c.req.raw.body ? "half" : void 0 | ||
| }; | ||
| const request = new Request(url.toString(), requestInit); | ||
| return app.fetch(request, c.env, getExecutionCtx(c)); | ||
@@ -90,0 +92,0 @@ } |
@@ -11,3 +11,3 @@ // src/client/utils.ts | ||
| for (const [k, v] of Object.entries(params)) { | ||
| const reg = new RegExp("/:" + k + "(?:{[^/]+})?\\??"); | ||
| const reg = new RegExp("/:" + k + "(?:{[^/]+})?\\??(?=/|$)"); | ||
| urlString = urlString.replace(reg, v ? `/${v}` : ""); | ||
@@ -14,0 +14,0 @@ } |
@@ -37,3 +37,3 @@ // src/middleware/cache/index.ts | ||
| if (cacheControlDirectives) { | ||
| const existingDirectives = c.res.headers.get("Cache-Control")?.split(",").map((d) => d.trim().split("=", 1)[0]) ?? []; | ||
| const existingDirectives = c.res.headers.get("Cache-Control")?.split(",").map((d) => d.trim().split("=", 1)[0].toLowerCase()) ?? []; | ||
| for (const directive of cacheControlDirectives) { | ||
@@ -40,0 +40,0 @@ let [name, value] = directive.trim().split("=", 2); |
@@ -38,3 +38,4 @@ // src/middleware/compress/index.ts | ||
| const contentLength = ctx.res.headers.get("Content-Length"); | ||
| if (ctx.res.headers.has("Content-Encoding") || // already encoded | ||
| if (ctx.res.status === 206 || // partial content, Content-Range refers to the uncompressed bytes | ||
| ctx.res.headers.has("Content-Encoding") || // already encoded | ||
| ctx.res.headers.has("Transfer-Encoding") || // already encoded or chunked | ||
@@ -41,0 +42,0 @@ ctx.req.method === "HEAD" || // HEAD request |
@@ -62,7 +62,9 @@ // src/middleware/method-override/index.ts | ||
| url.searchParams.delete(queryName); | ||
| const request = new Request(url.toString(), { | ||
| const requestInit = { | ||
| body: c.req.raw.body, | ||
| headers: c.req.raw.headers, | ||
| method | ||
| }); | ||
| method, | ||
| duplex: c.req.raw.body ? "half" : void 0 | ||
| }; | ||
| const request = new Request(url.toString(), requestInit); | ||
| return app.fetch(request, c.env, getExecutionCtx(c)); | ||
@@ -69,0 +71,0 @@ } |
@@ -34,3 +34,3 @@ /** | ||
| export interface WSContextInit<T = unknown> { | ||
| send(data: string | ArrayBuffer | Uint8Array, options: SendOptions): void; | ||
| send(data: string | ArrayBuffer | Uint8Array<ArrayBuffer>, options: SendOptions): void; | ||
| close(code?: number, reason?: string): void; | ||
@@ -37,0 +37,0 @@ raw?: T; |
+3
-3
| { | ||
| "name": "hono", | ||
| "version": "4.12.29", | ||
| "version": "4.12.30", | ||
| "description": "Web framework built on Web Standards", | ||
@@ -669,3 +669,3 @@ "main": "dist/cjs/index.js", | ||
| "devDependencies": { | ||
| "@hono/eslint-config": "^2.1.0", | ||
| "@hono/eslint-config": "^2.1.1", | ||
| "@hono/node-server": "^2.0.2", | ||
@@ -688,3 +688,3 @@ "@types/jsdom": "^21.1.7", | ||
| "publint": "0.3.15", | ||
| "typescript": "^5.9.2", | ||
| "typescript": "^6.0.3", | ||
| "undici": "^6.27.0", | ||
@@ -691,0 +691,0 @@ "vite-plugin-fastly-js-compute": "^0.4.2", |
1355133
0.03%37650
0.02%