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 0fbe4de commit 570bf41
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/client.js
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 570bf41

Please sign in to comment.