Skip to content

Commit 543d642

Browse files
committed
Simplify valid path check
1 parent fd36f8c commit 543d642

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/node/app/static.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export class StaticHttpProvider extends HttpProvider {
3939

4040
// Make sure it's in code-server or a plugin.
4141
const validPaths = [this.rootPath, process.env.PLUGIN_DIR]
42-
if (!validPaths.find((p) => typeof p !== "undefined" && p.length > 0 && resourcePath.startsWith(p))) {
42+
if (!validPaths.find((p) => p && resourcePath.startsWith(p))) {
4343
this.ensureAuthenticated(request)
4444
}
4545

0 commit comments

Comments
 (0)