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/node-server
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.0.8
Choose a base ref
...
head repository: honojs/node-server
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v2.0.9
Choose a head ref
  • 4 commits
  • 9 files changed
  • 4 contributors

Commits on Jul 11, 2026

  1. fix(websocket): polyfill missing ErrorEvent global (#371)

    Node.js has no global ErrorEvent, so `new ErrorEvent(...)` threw a
    ReferenceError and silently swallowed the user's onError handler.
    otnc authored Jul 11, 2026
    Configuration menu
    Copy the full SHA
    912e3fd View commit details
    Browse the repository at this point in the history

Commits on Jul 12, 2026

  1. fix(serve-static): correct Range header parsing edge cases (#372)

    * fix(serve-static): correct Range header parsing edge cases
    
    - `bytes=-N` (suffix range) now returns the last N bytes instead of
      the first N+1 bytes.
    - `bytes=0-0` now returns 1 byte instead of the whole file (the old
      `parseInt(...) || size - 1` treated a valid 0 as falsy).
    - An unsatisfiable range (start beyond EOF, or start > end) now
      returns 416 instead of crashing createReadStream with a RangeError.
    
    * fix(serve-static): reject non-digit range values and fix empty-file crash
    
    - Range segments with trailing garbage (e.g. `bytes=0-1x`) were silently
      truncated by parseInt into `0-1` instead of being treated as malformed.
      first-pos/last-pos/suffix-length are now validated as `1*DIGIT`.
    - A Range request on an empty file fell through to createReadStream with
      end=-1 and crashed with 500 instead of returning 416.
    
    Addresses review feedback from @usualoma on #372.
    
    * refactor(serve-static): separate range parsing and resolution
    
    ---------
    
    Co-authored-by: Taku Amano <taku@taaas.jp>
    otnc and usualoma authored Jul 12, 2026
    Configuration menu
    Copy the full SHA
    fdb87ba View commit details
    Browse the repository at this point in the history

Commits on Jul 14, 2026

  1. fix: recover complete request bodies after client disconnect (#375)

    * fix: decode string chunks with the stream encoding
    
    When application code has called setEncoding() on the IncomingMessage, data events yield strings in that encoding. Converting those chunks back to bytes as UTF-8 corrupts bodies decoded with another encoding.
    
    Decode with incoming.readableEncoding and cover the streamed latin1 case.
    
    * fix: recover complete HTTP/1 bodies after client disconnect
    
    A client can disconnect after Node has parsed the complete HTTP/1 request but before the application reads it. Recover the untouched buffered body for direct reads, native Request reads, formData(), and raw body streams.
    
    Share and cache the recovery result across paths, preserve application errors, reject lossy string encodings, and validate canonical content-length values. Add real-socket and synthetic coverage with bounded waits so regressions fail without leaking the test server.
    
    * fix: avoid recovering partially consumed request bodies
    
    Inspired by #373.
    
    Co-authored-by: BlankParticle <blankparticle@gmail.com>
    
    * refactor: extract normalizeAbortError for body read failures
    
    Adopts the normalizeAbortError helper from
    #373.
    
    Co-authored-by: BlankParticle <blankparticle@gmail.com>
    
    * refactor: reuse disconnected body recovery guard
    
    Co-authored-by: BlankParticle <blankparticle@gmail.com>
    
    ---------
    
    Co-authored-by: BlankParticle <blankparticle@gmail.com>
    usualoma and BlankParticle authored Jul 14, 2026
    Configuration menu
    Copy the full SHA
    51f3bf5 View commit details
    Browse the repository at this point in the history
  2. 2.0.9

    yusukebe committed Jul 14, 2026
    Configuration menu
    Copy the full SHA
    9842021 View commit details
    Browse the repository at this point in the history
Loading