Skip to content

Commit b8623a3

Browse files
committed
chore: If we can't split, just assume empty, it's for testing purposes
1 parent 66839d7 commit b8623a3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/integration/fixtures/httpsServerProxyTest.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ import type { Duplex } from "stream";
1212

1313
function parseHTTPAuthHeader(header: string | undefined): [string, string] {
1414
if (!header?.startsWith("Basic ")) return ["", ""];
15-
const [username = "", pw = ""] = Buffer.from(header.split(" ")[1], "base64").toString().split(":");
15+
const [username = "", pw = ""] = Buffer.from(header.split(" ")[1] ?? "", "base64")
16+
.toString()
17+
.split(":");
1618
return [username, pw];
1719
}
1820

0 commit comments

Comments
 (0)