Skip to content

fix: correct response handling edge cases#3855

Open
SisyphusZheng wants to merge 1 commit into
freshframework:mainfrom
SisyphusZheng:fix/response-edge-cases
Open

fix: correct response handling edge cases#3855
SisyphusZheng wants to merge 1 commit into
freshframework:mainfrom
SisyphusZheng:fix/response-edge-cases

Conversation

@SisyphusZheng

Copy link
Copy Markdown
Contributor

Three fixes for HTTP response correctness:

  1. HEAD requests: Deno.serve already strips bodies from HEAD responses. The explicit
    ew Response(null, result)\ wrapper was unnecessary and could produce incorrect Content-Length headers (RFC 7231 §4.3.2). Remove the special case.

  2. Malformed URI params: \decodeURI()\ throws a URIError on malformed percent-encoding (e.g. %GG), causing an uncaught 500 Internal Server Error. Wrap in try/catch and fall back to the raw value so the handler can respond appropriately.

  3. DiskBuildCache.readFile(): Replace the \�sync\ + \deno-lint-ignore require-await\ pattern with an explicit \Promise.reject(), which is cleaner and signals the intentional not-implemented status without requiring a lint suppression.

Three fixes for HTTP response correctness:

1. HEAD requests: Deno.serve already strips bodies from HEAD responses. The explicit \
ew Response(null, result)\ wrapper was unnecessary and could produce incorrect Content-Length headers (RFC 7231 §4.3.2). Remove the special case and let Deno handle it.

2. Malformed URI params: \decodeURI()\ throws a URIError on malformed percent-encoding (e.g. %GG), causing an uncaught 500 error instead of a proper 400. Wrap in try/catch and fall back to the raw value.

3. DiskBuildCache.readFile(): Replace the \�sync\ + lint-ignore pattern with an explicit \Promise.reject()\ to cleanly signal the intentional not-implemented status.
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.

1 participant