Skip to content

Commit 84f02fa

Browse files
committed
more unit tests converted
1 parent 53f362e commit 84f02fa

File tree

5 files changed

+488
-409
lines changed

5 files changed

+488
-409
lines changed

lib/http-proxy/common.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,9 @@ export function setupOutgoing(
106106

107107
// the final path is target path + relative path requested by user:
108108
const target = options[forward || "target"];
109+
// target if defined is a URL object so has attribute "pathname", not "path".
109110
const targetPath =
110-
target && options.prependPath !== false ? getPath(target.pathname) : "";
111+
target && options.prependPath !== false ? getPath(target.pathname) : "/";
111112

112113
let outgoingPath = options.toProxy ? req.url : getPath(req.url);
113114

0 commit comments

Comments
 (0)