diff --git a/packages/hono/src/routeMatcher.ts b/packages/hono/src/routeMatcher.ts index ab9cb089..2070c43f 100644 --- a/packages/hono/src/routeMatcher.ts +++ b/packages/hono/src/routeMatcher.ts @@ -35,8 +35,8 @@ export function makeRouteMatcher(endpoints: AnyEndpoint[]) { const [method, path] = endpointToHono(endpoint.endpoint); routeMatcher.add(method, path, endpoint); if (method === "GET") { - // Hono route matching is method-specific, so also add a - // HEAD route for GET endpoints + // Add HEAD route for every GET route so that HEAD requests + // are also matched. routeMatcher.add("HEAD", path, endpoint); } }