From 680644ae153cd2ef6817e0df88db50fb64ab5c36 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 c3e2d016608aed..93390c9b35fa63 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -754,6 +754,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)`