Skip to content

Commit

Permalink
fix: ignore headers timeout after statusCode
Browse files Browse the repository at this point in the history
Refs: #268
  • Loading branch information
ronag committed Jul 29, 2020
1 parent 4080a28 commit 7452e9e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,10 @@ class Parser extends HTTPParser {
}

[HTTPParser.kOnTimeout] () {
if (this.statusCode) {
// https://github.com/mcollina/undici/issues/268
return
}
util.destroy(this.socket, new HeadersTimeoutError())
}

Expand Down Expand Up @@ -457,13 +461,13 @@ class Parser extends HTTPParser {

assert(statusCode >= 100)

this.statusCode = null
this.headers = null

if (statusCode < 200) {
return
}

this.statusCode = null
this.headers = null

request.onComplete(headers)

this.read = 0
Expand Down

0 comments on commit 7452e9e

Please sign in to comment.