Packages

hono

4.13.19 · 16 Nov 2026MIT113.6M / weekRepositoryHomepagenpmAtom feed

Your version

3.2.4

4 Jun 2023Where it was published

3.12.12 is the newest release of 3.x.

In short

1 breaking2 new1 faster2 fixed2 internal

  • Breaking

    This release includes a "small" breaking change.

Security

44 advisories affect 3.2.4; 4.13.16 fixes them

39 more

Release note

"Small" Breaking Change

This release includes a "small" breaking change.

Before this release, if a HEAD request was received, the app would handle it with the handler defined in app.head(). If there were no preferred handlers, it would return "Not Found".

app.head('/foo', (c) => {
  return new Response(null, {
    headers: {
      Foo: 'Bar',
    },
  })
})

This would handle:

HEAD /foo

Since this release, app.head() will not be enabled. Instead, the app will automatically return the responses for HEAD requests if it has a preferred app.get() handler. This means you don't have to set the handlers for HEAD explicitly.

const app = new Hono()

app.get('/', (c) => {
  return c.text('Foo')
})

export default app
$ curl --head http://localhost:8787/
HTTP/1.1 200 OK
Content-Type: text/plain;charset=UTF-8

If you want to customize the response for HEAD method, write like the following:

app.get('/', (c) => {
  if (c.req.method === 'HEAD') {
    return new Response(null, {
      headers: {
        'Content-Length': '12345',
      },
    })
  }
  return c.text('Foo')
})

You can still use app.head(), but it will not have any effect. So, you should remove them.

What's Changed

  • Define JSX.ElementChildrenAttribute interface

  • reg-exp-router: Register static paths first for duplicate checking.

  • Use indexOf() intead of includes()

  • Handle HEAD method

  • tire-router/pattern-router: Fixed the named capture issue

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.