Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: honojs/hono
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v4.12.21
Choose a base ref
...
head repository: honojs/hono
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v4.12.22
Choose a head ref
  • 6 commits
  • 12 files changed
  • 9 contributors

Commits on May 22, 2026

  1. chore: update vitest to v4 and cleanups (#4952)

    * chore: update vitest to v4 and cleanups
    
    * ci: apply automated fixes
    
    * fix: vitest jsx import
    
    ---------
    
    Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
    BlankParticle and autofix-ci[bot] authored May 22, 2026
    Configuration menu
    Copy the full SHA
    cf6ef70 View commit details
    Browse the repository at this point in the history
  2. fix(mime): specify charset parameter per MIME type instead of mechani…

    …cal detection (#4912)
    
    Per #4510:
    
    - Inline `; charset=utf-8` in `_baseMimes` for all text/* entries plus
      `image/svg+xml`, `application/xhtml+xml`, and `application/xml`,
      which are XML-based formats that benefit from an explicit charset.
    - Drop the `if (mimeType.startsWith("text"))` block in `getMimeType`;
      the charset now lives in the data, not in the lookup logic. Output
      for text types is unchanged (still "text/<sub>; charset=utf-8").
    - Update `getExtension` to compare the base type (the part before the
      first `;`), so callers can pass either a raw type ("text/html") or
      one with parameters ("text/html; charset=utf-8") and still get the
      correct extension back.
    
    Tests: 5 mime.test.ts cases pass (3 existing + 2 new) covering the new
    charset values for svg/xhtml/xml/ics/mjs/css/csv and getExtension with
    parameters.
    
    Closes #4510
    renatograsso10 authored May 22, 2026
    Configuration menu
    Copy the full SHA
    a192df0 View commit details
    Browse the repository at this point in the history
  3. fix(compress): respect Accept-Encoding when encoding option is set (#…

    …4951)
    
    * fix(compress): skip compression when client does not accept the configured encoding
    
    When the encoding option is set, the middleware previously compressed responses
    unconditionally, regardless of the Accept-Encoding header. This could send a
    response in an encoding the client cannot decode (for example, returning gzip
    when the client only advertised deflate, or when Accept-Encoding is absent).
    
    Honor the client's Accept-Encoding header even when an encoding is explicitly
    configured, falling back to no compression when the configured encoding is
    not accepted.
    
    * fix(compress): use parseAccept to honor q-values, wildcard, and case
    
    Address review from @yusukebe. The previous version used String.includes
    on the raw Accept-Encoding header, which treated x-gzip as gzip, ignored
    q=0 explicit refusals, and did not understand the wildcard. Switch to
    parseAccept (already used by accepts middleware) and pick the candidate
    encoding with the highest non-zero q value, falling back to the wildcard
    q if the candidate has no explicit entry.
    
    Add seven regression tests covering q=0 on the configured encoding, q=0
    fallback to another candidate, wildcard \*, case-insensitive tokens,
    x-gzip non-matching, highest-q wins, and gzip-over-deflate tie-break.
    
    * fix(compress): short-circuit selectEncoding when q is 1
    
    Per @usualoma: q values are almost always 1 in practice, so short-circuit
    and return immediately for the common path instead of continuing to scan
    the remaining candidates.
    
    
    Co-authored-by: Yusuke Wada <[email protected]>
    Co-authored-by: Taku Amano <[email protected]>
    3 people authored May 22, 2026
    Configuration menu
    Copy the full SHA
    f0ed246 View commit details
    Browse the repository at this point in the history
  4. fix(deno): echo negotiated WebSocket subprotocol in upgrade response (#…

    …4955)
    
    * fix(deno): echo negotiated WebSocket subprotocol in upgrade response
    
    The Deno adapter did not set the `Sec-WebSocket-Protocol` header on the
    upgrade response, so browsers such as Chrome rejected connections that
    requested a subprotocol. Read the first value from the request's
    `Sec-WebSocket-Protocol` header and pass it as the `protocol` option to
    `Deno.upgradeWebSocket`, while still honoring an explicitly provided
    `protocol` option.
    
    Closes #4439
    
    * add a test
    
    ---------
    
    Co-authored-by: ATOM00blue <[email protected]>
    Co-authored-by: Yusuke Wada <[email protected]>
    3 people authored May 22, 2026
    Configuration menu
    Copy the full SHA
    7e0555d View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    6bc0dff View commit details
    Browse the repository at this point in the history
  6. 4.12.22

    yusukebe committed May 22, 2026
    Configuration menu
    Copy the full SHA
    2f01b77 View commit details
    Browse the repository at this point in the history
Loading