From 388d125a6447bb21e00a782205ff372a7a0d8789 Mon Sep 17 00:00:00 2001 From: wenningplus Date: Tue, 9 Jun 2020 13:42:07 +0800 Subject: [PATCH] http: expose host and protocol on ClientRequest Allow host and protocol to be inspected. PR-URL: https://github.com/nodejs/node/pull/33803 Fixes: https://github.com/nodejs/node/issues/2461 Reviewed-By: Robert Nagy Reviewed-By: Trivikram Kamat Reviewed-By: James M Snell --- doc/api/http.md | 21 +++++++++++++++++ lib/_http_client.js | 2 ++ .../parallel/test-http-outgoing-properties.js | 23 +++++++++++++++++++ 3 files changed, 46 insertions(+) diff --git a/doc/api/http.md b/doc/api/http.md index 0bf2e28cd3e2c7..a6ab067ce5c9f6 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -688,6 +688,27 @@ added: v0.4.0 * {string} The request path. +### `request.method` + + +* {string} The request method. + +### `request.host` + + +* {string} The request host. + +### `request.protocol` + + +* {string} The request protocol. + ### `request.removeHeader(name)`