Archived
1
0

Fix /vscode route being shadowed by / (#4522)

This causes / to always take precedence and on the VS Code side we would
see /vscode instead of / so the matching does not work correctly.
This commit is contained in:
Asher 2021-11-17 10:20:01 -06:00 committed by GitHub
parent cd26f84bc6
commit dd29a823c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -141,7 +141,7 @@ export const register = async (app: App, args: DefaultedArgs): Promise<Disposabl
const vsServerRouteHandler = new CodeServerRouteWrapper() const vsServerRouteHandler = new CodeServerRouteWrapper()
// Note that the root route is replaced in Coder Enterprise by the plugin API. // Note that the root route is replaced in Coder Enterprise by the plugin API.
for (const routePrefix of ["/", "/vscode"]) { for (const routePrefix of ["/vscode", "/"]) {
app.router.use(routePrefix, vsServerRouteHandler.router) app.router.use(routePrefix, vsServerRouteHandler.router)
app.wsRouter.use(routePrefix, vsServerRouteHandler.wsRouter) app.wsRouter.use(routePrefix, vsServerRouteHandler.wsRouter)
} }