Make providers endpoint-agnostic
A provider can now be registered on multiple endpoints (or potentially moved if needed).
This commit is contained in:
@@ -24,7 +24,7 @@ export class ProxyHttpProvider extends HttpProvider {
|
||||
const port = route.base.replace(/^\//, "")
|
||||
return {
|
||||
proxy: {
|
||||
base: `${this.options.base}/${port}`,
|
||||
base: `${route.providerBase}/${port}`,
|
||||
port,
|
||||
},
|
||||
}
|
||||
@@ -35,7 +35,7 @@ export class ProxyHttpProvider extends HttpProvider {
|
||||
const port = route.base.replace(/^\//, "")
|
||||
return {
|
||||
proxy: {
|
||||
base: `${this.options.base}/${port}`,
|
||||
base: `${route.providerBase}/${port}`,
|
||||
port,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ export class VscodeHttpProvider extends HttpProvider {
|
||||
if (!this.isRoot(route)) {
|
||||
throw new HttpError("Not found", HttpCode.NotFound)
|
||||
} else if (!this.authenticated(request)) {
|
||||
return { redirect: "/login", query: { to: this.options.base } }
|
||||
return { redirect: "/login", query: { to: route.providerBase } }
|
||||
}
|
||||
try {
|
||||
return await this.getRoot(request, route)
|
||||
|
||||
Reference in New Issue
Block a user