Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(flash): Always send correct number of bytes when handling HEAD requests #17740

Merged
merged 2 commits into from
Feb 12, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix(flash): Always send correct number of bytes when handling HEAD re…
…quests
  • Loading branch information
kamilogorek committed Feb 11, 2023
commit 1f0a737bbb05ba0ea03c69002eaa9790e2cd58b5
4 changes: 3 additions & 1 deletion ext/flash/01_http.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,11 +316,13 @@ async function handleResponse(
respBody,
length,
);
// A HEAD request always ignores body, but includes the correct content-length size.
const responseLen = method === 1 ? core.byteLength(responseStr) : length;
writeFixedResponse(
serverId,
i,
responseStr,
length,
responseLen,
!ws, // Don't close socket if there is a deferred websocket upgrade.
respondFast,
);
Expand Down