File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -98,8 +98,12 @@ import { methods as METHODS } from "node:_http_common";
9898import { deprecate } from "node:util" ;
9999
100100const { internalRidSymbol } = core ;
101- const { ArrayIsArray, StringPrototypeToLowerCase, SafeArrayIterator } =
102- primordials ;
101+ const {
102+ ArrayIsArray,
103+ StringPrototypeIncludes,
104+ StringPrototypeToLowerCase,
105+ SafeArrayIterator,
106+ } = primordials ;
103107
104108type Chunk = string | Buffer | Uint8Array ;
105109
@@ -969,9 +973,9 @@ class ClientRequest extends OutgoingMessage {
969973 path = "/" + path ;
970974 }
971975 const url = new URL (
972- `${ protocol } //${ auth ? `${ auth } @` : "" } ${ host } ${
973- port === 80 ? "" : `: ${ port } `
974- } ${ path } `,
976+ `${ protocol } //${ auth ? `${ auth } @` : "" } ${
977+ StringPrototypeIncludes ( host , ":" ) ? `[ ${ host } ]` : host
978+ } ${ port === 80 ? "" : `: ${ port } ` } ${ path } `,
975979 ) ;
976980 url . hash = hash ;
977981 return url . href ;
You can’t perform that action at this time.
0 commit comments