Skip to content

Commit

Permalink
fix: add more expectsPayload methods (#3715)
Browse files Browse the repository at this point in the history
  • Loading branch information
ronag authored Oct 11, 2024
1 parent 4869e5e commit 39c5974
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lib/dispatcher/client-h1.js
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,10 @@ function writeH1 (client, request) {
const expectsPayload = (
method === 'PUT' ||
method === 'POST' ||
method === 'PATCH'
method === 'PATCH' ||
method === 'QUERY' ||
method === 'PROPFIND' ||
method === 'PROPPATCH'
)

if (util.isFormDataLike(body)) {
Expand Down Expand Up @@ -1139,7 +1142,7 @@ function writeBuffer (abort, body, client, request, socket, contentLength, heade
socket.uncork()
request.onBodySent(body)

if (!expectsPayload) {
if (!expectsPayload && request.reset !== false) {
socket[kReset] = true
}
}
Expand Down Expand Up @@ -1169,7 +1172,7 @@ async function writeBlob (abort, body, client, request, socket, contentLength, h
request.onBodySent(buffer)
request.onRequestSent()

if (!expectsPayload) {
if (!expectsPayload && request.reset !== false) {
socket[kReset] = true
}

Expand Down Expand Up @@ -1270,7 +1273,7 @@ class AsyncWriter {
socket.cork()

if (bytesWritten === 0) {
if (!expectsPayload) {
if (!expectsPayload && request.reset !== false) {
socket[kReset] = true
}

Expand Down

0 comments on commit 39c5974

Please sign in to comment.