Skip to content

Commit 1fd1b7e

Browse files
committed
Namespace subfolder storing .vscode/* files should always be uppercase
1 parent 014fed3 commit 1fd1b7e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/utils/index.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,7 @@ export async function terminalWithDocker(): Promise<vscode.Terminal> {
355355
* Also alter query to specify `ns=%SYS&csp=1`
356356
* Also handles the alternative syntax isfs://server:namespace/
357357
* in which there is no ns queryparam
358+
* For both syntaxes the namespace folder name is uppercased
358359
*
359360
* @returns uri, altered if necessary.
360361
* @throws if `ns` queryparam is missing but required.
@@ -368,17 +369,17 @@ export function redirectDotvscodeRoot(uri: vscode.Uri): vscode.Uri {
368369
let namespace: string;
369370
const nsMatch = `&${uri.query}&`.match(/&ns=([^&]+)&/);
370371
if (nsMatch) {
371-
namespace = nsMatch[1];
372-
const newQueryString = (("&" + uri.query).replace(`ns=${namespace}`, "ns=%SYS") + "&csp=1").slice(1);
372+
namespace = nsMatch[1].toUpperCase();
373+
const newQueryString = (("&" + uri.query).replace(`ns=${namespace}`, "ns=%SYS") + "&csp").slice(1);
373374
return uri.with({ path: `/_vscode/${namespace}${dotMatch[2] || ""}`, query: newQueryString });
374375
} else {
375376
const parts = uri.authority.split(":");
376377
if (parts.length === 2) {
377-
namespace = parts[1];
378+
namespace = parts[1].toUpperCase();
378379
return uri.with({
379380
authority: `${parts[0]}:%SYS`,
380381
path: `/_vscode/${namespace}${dotMatch[2] || ""}`,
381-
query: uri.query + "&csp=1",
382+
query: uri.query + "&csp",
382383
});
383384
}
384385
}

0 commit comments

Comments
 (0)