Skip to content

Commit

Permalink
fix(node-http-handler): fix invalid usage of parsed url
Browse files Browse the repository at this point in the history
  • Loading branch information
Defman committed Sep 20, 2024
1 parent b12dc1d commit 5810491
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/node-http-handler/src/node-http-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,18 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
if (request.fragment) {
path += `#${request.fragment}`;
}

let hostname: string;
if (request.hostname.startsWith("[") && request.hostname.endsWith("]")) {
hostname = request.hostname.slice(1, -1);
} else {
hostname = request.hostname;
}


const nodeHttpsOptions: RequestOptions = {
headers: request.headers,
host: request.hostname,
host: hostname,
method: request.method,
path,
port: request.port,
Expand Down

0 comments on commit 5810491

Please sign in to comment.