From 543d64268d3db34764e0fe8b7a716974e8720bfd Mon Sep 17 00:00:00 2001 From: Asher Date: Wed, 5 Aug 2020 12:45:50 -0500 Subject: [PATCH] Simplify valid path check --- src/node/app/static.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node/app/static.ts b/src/node/app/static.ts index 78085d3b..471d0c98 100644 --- a/src/node/app/static.ts +++ b/src/node/app/static.ts @@ -39,7 +39,7 @@ export class StaticHttpProvider extends HttpProvider { // Make sure it's in code-server or a plugin. const validPaths = [this.rootPath, process.env.PLUGIN_DIR] - if (!validPaths.find((p) => typeof p !== "undefined" && p.length > 0 && resourcePath.startsWith(p))) { + if (!validPaths.find((p) => p && resourcePath.startsWith(p))) { this.ensureAuthenticated(request) }