http: expose host and protocol on ClientRequest · nodejs/node@388d125 · GitHub
Skip to content

Commit 388d125

Browse files
wenningplusaddaleax
authored andcommitted
http: expose host and protocol on ClientRequest
Allow host and protocol to be inspected. PR-URL: #33803 Fixes: #2461 Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent be6aee9 commit 388d125

3 files changed

Lines changed: 46 additions & 0 deletions

File tree

doc/api/http.md

Lines changed: 21 additions & 0 deletions

lib/_http_client.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,8 @@ function ClientRequest(input, options, cb) {
213213
this.parser = null;
214214
this.maxHeadersCount = null;
215215
this.reusedSocket = false;
216+
this.host = host;
217+
this.protocol = protocol;
216218

217219
let called = false;
218220

test/parallel/test-http-outgoing-properties.js

Lines changed: 23 additions & 0 deletions

0 commit comments

Comments
 (0)