mirror of
https://github.com/coder/code-server.git
synced 2025-07-30 21:45:08 +08:00
Create helper for determining if route is the root
This commit is contained in:
@ -43,8 +43,7 @@ export class ApiHttpProvider extends HttpProvider {
|
||||
|
||||
public async handleRequest(route: Route, request: http.IncomingMessage): Promise<HttpResponse> {
|
||||
this.ensureAuthenticated(request)
|
||||
// Only serve root pages.
|
||||
if (route.requestPath && route.requestPath !== "/index.html") {
|
||||
if (!this.isRoot(route)) {
|
||||
throw new HttpError("Not found", HttpCode.NotFound)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user