Update hivegrid-cloud reference to latest main
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e98d38e716
commit
7b21524c86
3781 files changed
+373484
-225607
No files matched your search
@@ -5,7 +5,7 @@ export type HostRoutingRuntimeDecision =
|
||||
| { type: "reject"; status: 404 }
|
||||
| { type: "dispatch"; target: "api" | "web"; request: Request };
|
||||
|
||||
const internalWebApiProxyHeader = "x-toolctrl-internal-web-api-proxy";
|
||||
const internalWebApiProxyHeader = "x-hivegrid-internal-web-api-proxy";
|
||||
|
||||
export function getHostRoutingRuntimeDecision(request: Request): HostRoutingRuntimeDecision {
|
||||
const context = getHostRoutingContextFromRequest(request);
|
||||
@@ -19,6 +19,15 @@ export function getHostRoutingRuntimeDecision(request: Request): HostRoutingRunt
|
||||
};
|
||||
}
|
||||
|
||||
const legacyAdminLoginRedirect = getLegacyAdminLoginRedirect(request, context);
|
||||
if (legacyAdminLoginRedirect) {
|
||||
return {
|
||||
type: "redirect",
|
||||
status: 308,
|
||||
location: legacyAdminLoginRedirect,
|
||||
};
|
||||
}
|
||||
|
||||
if (isRemovedLegacyRoute(request, context)) {
|
||||
return {
|
||||
type: "reject",
|
||||
@@ -49,7 +58,22 @@ function isInternalWebApiProxyRequest(request: Request, context: ReturnType<type
|
||||
}
|
||||
|
||||
const pathname = new URL(request.url).pathname;
|
||||
return pathname === "/internal/api/usage" || pathname === "/internal/api/stripe.webhooks" || pathname.startsWith("/internal/api/workflows/");
|
||||
return pathname === "/internal/api/usage" || pathname === "/internal/api/billing.webhooks" || pathname.startsWith("/internal/api/workflows/");
|
||||
}
|
||||
|
||||
function getLegacyAdminLoginRedirect(request: Request, context: ReturnType<typeof getHostRoutingContextFromRequest>) {
|
||||
if (context !== "admin") {
|
||||
return null;
|
||||
}
|
||||
|
||||
const url = new URL(request.url);
|
||||
const normalizedPathname = url.pathname.replace(/\/+$/g, "") || "/";
|
||||
if (normalizedPathname !== "/admin/login") {
|
||||
return null;
|
||||
}
|
||||
|
||||
url.pathname = "/login";
|
||||
return url.toString();
|
||||
}
|
||||
|
||||
function isRemovedLegacyRoute(request: Request, context: ReturnType<typeof getHostRoutingContextFromRequest>) {
|
||||
|
||||
Reference in new issue
Block a user