Simplify valid path check

This commit is contained in:
Asher
2020-08-05 13:00:34 -05:00
parent fd36f8c168
commit 543d64268d
+1 -1
View File
@@ -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)
}