ReviewOS

home-lang/home

Bun parity: preserve final response URLs after redirects

#365
Closed chris opened this 10 days ago ·
10 days ago

Port js/web/fetch/fetch-url-after-redirect.test.ts from the copied Bun corpus.

Required behavior:

  • expose the originating IncomingMessage as ServerResponse.req
  • honor the full writeHead(status, statusMessage, headers) overload
  • follow the complete redirect chain and preserve the final target in Response.url
  • decode raw non-ASCII Location header bytes as UTF-8 before URL serialization to avoid double encoding
  • provide structured Node HTTP response operation, phase, method, URL, cause, and composed stack context for response failures
  • add a permanent focused regression and advance corpus position 4147 with zero failures or unsupported tests

Tracked under #66.

10 days ago

Completed in 51d2f9d and pushed directly to main.

Implemented:

  • ServerResponse.req linked to the originating IncomingMessage
  • full writeHead(status, statusMessage, headers) overload support
  • complete redirect chain final URL preservation
  • raw byte-valued Location header decoding through strict UTF-8 before URL serialization, avoiding double encoding
  • NodeHTTPServerResponseError with ERR_HTTP_SERVER_RESPONSE, operation, phase, method, URL, cause, and composed stack
  • permanent focused regression for both upstream cases

Validation:

  • indexed Bun corpus position 4147: 2 passed, 0 failed, 0 todo, 0 unsupported
  • focused final redirect URL regression: passed
  • zig build --cache-dir /private/tmp/home-zig-abi-cache: passed

Sign in to comment on this issue.