mirror of
https://github.com/coder/code-server.git
synced 2025-07-28 20:43:24 +08:00
Create helper for determining if route is the root
This commit is contained in:
@ -359,6 +359,14 @@ export abstract class HttpProvider {
|
||||
}
|
||||
return cookies as T
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if the route is for the root page. For example /base, /base/,
|
||||
* or /base/index.html but not /base/path or /base/file.js.
|
||||
*/
|
||||
protected isRoot(route: Route): boolean {
|
||||
return !route.requestPath || route.requestPath === "/index.html"
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user