Skip to content

Commit 5b53ab1

Browse files
committed
Treat absolute URL reqs as setting the tunnel destination in themselves
Previously if you tunnelled to a proxy server, and then sent GET http://example.com, we treated the proxy server address as your intended final destionation. That's clearly not quite right - it's weird that you would do this, but if you do, the final request is itself another tunnel really and we should treat that as the final destination.
1 parent 6974e26 commit 5b53ab1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/util/request-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ export function preprocessRequest(req: ExtendedRawRequest, options: {
400400
req.path = getPathFromAbsoluteUrl(req.url!);
401401
req.destination = getDestination(
402402
req.protocol,
403-
req.socket[LastTunnelAddress] ?? getHostFromAbsoluteUrl(req.url!)
403+
getHostFromAbsoluteUrl(req.url!) // We ignore LastTunnelAddress - this *is* a tunnel
404404
);
405405

406406
const proxyAuthHeader = getHeaderValue(rawHeaders, 'proxy-authorization');

0 commit comments

Comments
 (0)