@hapi/hapi
Advanced tools
Comparing version 21.3.4 to 21.3.5
@@ -560,2 +560,21 @@ 'use strict'; | ||
if (request) { | ||
// If a request is available, it means that the connection and parsing has progressed far enough to have created the request. | ||
if (err.code === 'HPE_INVALID_METHOD') { | ||
// This parser error is for a pipelined request. Schedule destroy once current request is done. | ||
request.raw.res.once('close', () => { | ||
if (socket.readable) { | ||
socket.end(internals.badRequestResponse); | ||
} | ||
else { | ||
socket.destroy(err); | ||
} | ||
}); | ||
return; | ||
} | ||
const error = Boom.badRequest(); | ||
@@ -562,0 +581,0 @@ error.output.headers = { connection: 'close' }; |
@@ -496,3 +496,3 @@ 'use strict'; | ||
if (!Boom.isBoom(this.response)) { | ||
if (this.response._close) { | ||
if (this.response.statusCode === 500 && | ||
@@ -505,5 +505,3 @@ this.response._error) { | ||
if (this.response._close) { | ||
this.response._close(); | ||
} | ||
this.response._close(); | ||
} | ||
@@ -527,9 +525,7 @@ | ||
this.response._close(); | ||
this.response._close?.(); | ||
} | ||
if (this.info.completed) { | ||
if (response._close) { | ||
response._close(); | ||
} | ||
response._close?.(); | ||
@@ -536,0 +532,0 @@ return; |
@@ -5,3 +5,3 @@ { | ||
"homepage": "https://hapi.dev", | ||
"version": "21.3.4", | ||
"version": "21.3.5", | ||
"repository": "git://github.com/hapijs/hapi", | ||
@@ -8,0 +8,0 @@ "main": "lib/index.js", |
414806
8485