From 5f7f7f1a92b9c2a006fb3a695ff4c51c26bc0015 Mon Sep 17 00:00:00 2001 From: Asher Date: Fri, 18 Dec 2020 11:21:32 -0600 Subject: [PATCH] Simplify query concatenation in URL callback Cases in URLs like ?&a=b or ?a=b& appear to be handled just fine. --- src/node/routes/vscode.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node/routes/vscode.ts b/src/node/routes/vscode.ts index 85d902d31..38ac42bb1 100644 --- a/src/node/routes/vscode.ts +++ b/src/node/routes/vscode.ts @@ -151,7 +151,7 @@ router.get("/callback", ensureAuthenticated, async (req, res) => { scheme: getFirstString(req.query["vscode-scheme"]) || "code-oss", authority: getFirstString(req.query["vscode-authority"]), path: getFirstString(req.query["vscode-path"]), - query: (getFirstString(req.query.query) ? getFirstString(req.query.query) + "&" : "") + qs.stringify(query), + query: (getFirstString(req.query.query) || "") + "&" + qs.stringify(query), fragment: getFirstString(req.query["vscode-fragment"]), }, // Make sure the map doesn't leak if nothing fetches this URI.