Skip to content

Comments

fix: Improve handling of HEAD requests when using hono plugin#103

Merged
yolken-stainless merged 2 commits intomainfrom
yolken-fix-hono-head
Jan 9, 2026
Merged

fix: Improve handling of HEAD requests when using hono plugin#103
yolken-stainless merged 2 commits intomainfrom
yolken-fix-hono-head

Conversation

@yolken-stainless
Copy link
Contributor

@yolken-stainless yolken-stainless commented Jan 9, 2026

Description

This change fixes the hono plugin so that it properly handles HEAD requests; currently, these will result in a 405 error even though the underlying hono library supports them.

This change also fixes the tests in the hono plugin package so they match the conventions of the other packages.

Testing

Testing completed successfully via extra unit tests.

`);
});

test("head posts", async () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test fails in main and passes with the fix.

for (const endpoint of endpoints) {
const [method, path] = endpointToHono(endpoint.endpoint);
routeMatcher.add(method, path, endpoint);
if (method === "GET") {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The actual fix.

"scripts": {
"clean": "rimraf dist *.tsbuildinfo"
"clean": "rimraf dist *.tsbuildinfo",
"test": "jest"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: oops this was my bad. if we're going to use jest we should remove vitest in devdeps

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@yolken-stainless yolken-stainless merged commit fd22090 into main Jan 9, 2026
1 check passed
@yolken-stainless yolken-stainless changed the title Fix handling of HEAD requests when using hono plugin fix: Improve handling of HEAD requests when using hono plugin Jan 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants