Skip to content

Commit 5b2c7a6

Browse files
author
Rafael Calpena Rodrigues
authored
Wait for Authenticated Function
`proxy` should `await` for result of `authenticated` call to avoid security issues.
1 parent 91589fd commit 5b2c7a6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/node/routes/pathProxy.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ const getProxyTarget = (req: Request, passthroughPath?: boolean): string => {
1414
return `http://0.0.0.0:${req.params.port}/${req.params[0] || ""}${query ? `?${query}` : ""}`
1515
}
1616

17-
export function proxy(
17+
export async function proxy(
1818
req: Request,
1919
res: Response,
2020
opts?: {
2121
passthroughPath?: boolean
2222
},
2323
): void {
24-
if (!authenticated(req)) {
24+
if (!(await authenticated(req))) {
2525
// If visiting the root (/:port only) redirect to the login page.
2626
if (!req.params[0] || req.params[0] === "/") {
2727
const to = self(req)

0 commit comments

Comments
 (0)