summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAustin Wright <aaa@bzfx.net>2019-06-27 16:10:55 -0700
committerMichaƫl Zasso <targos@protonmail.com>2019-07-20 11:13:05 +0200
commit2308c7412a12d3d7a61a8b66ba236f8a17a1c699 (patch)
tree3a6a6d1696b5836bc1f9340cb4d651bf1691f10a /lib
parent9b2eee12eb56c0439165282619d92c192a6663e7 (diff)
downloadandroid-node-v8-2308c7412a12d3d7a61a8b66ba236f8a17a1c699.tar.gz
android-node-v8-2308c7412a12d3d7a61a8b66ba236f8a17a1c699.tar.bz2
android-node-v8-2308c7412a12d3d7a61a8b66ba236f8a17a1c699.zip
http: expose headers on an http.ClientRequest "information" event
1xx intermediate status responses are allowed to have headers; so expose the "httpVersion", "httpVersionMajor", "httpVersionMinor", "headers", "rawHeaders", and "statusMessage" properties on this event. PR-URL: https://github.com/nodejs/node/pull/28459 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/_http_client.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/_http_client.js b/lib/_http_client.js
index fcd7ca90ac..11e946c893 100644
--- a/lib/_http_client.js
+++ b/lib/_http_client.js
@@ -545,7 +545,15 @@ function parserOnIncomingClient(res, shouldKeepAlive) {
req.emit('continue');
}
// Send information events to all 1xx responses except 101 Upgrade.
- req.emit('information', { statusCode: res.statusCode });
+ req.emit('information', {
+ statusCode: res.statusCode,
+ statusMessage: res.statusMessage,
+ httpVersion: res.httpVersion,
+ httpVersionMajor: res.httpVersionMajor,
+ httpVersionMinor: res.httpVersionMinor,
+ headers: res.headers,
+ rawHeaders: res.rawHeaders
+ });
return 1; // Skip body but don't treat as Upgrade.
}