mirror of
https://github.com/coder/code-server.git
synced 2025-07-30 05:22:04 +08:00
Simplify valid path check
This commit is contained in:
@ -39,7 +39,7 @@ export class StaticHttpProvider extends HttpProvider {
|
|||||||
|
|
||||||
// Make sure it's in code-server or a plugin.
|
// Make sure it's in code-server or a plugin.
|
||||||
const validPaths = [this.rootPath, process.env.PLUGIN_DIR]
|
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)
|
this.ensureAuthenticated(request)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user