diff --git a/src/lib/app.ts b/src/lib/app.ts index 5458519d3e..879ddc0688 100644 --- a/src/lib/app.ts +++ b/src/lib/app.ts @@ -75,7 +75,7 @@ export default async function getApp( // Preflight requests should not have Authorization headers, // so this must be handled before the API token middleware. app.options( - '/api/frontend*', + `${baseUriPath}/api/frontend*`, conditionalMiddleware( () => config.flagResolver.isEnabled('embedProxy'), corsOriginMiddleware(services), diff --git a/src/lib/middleware/api-token-middleware.ts b/src/lib/middleware/api-token-middleware.ts index 9b000019c4..0fd689f98e 100644 --- a/src/lib/middleware/api-token-middleware.ts +++ b/src/lib/middleware/api-token-middleware.ts @@ -15,7 +15,7 @@ const isProxyApi = ({ path }) => { // Handle all our current proxy paths which will redirect to the new // embedded proxy endpoint return ( - path.startsWith('/api/default/proxy') || + path.startsWith('/api/proxy') || path.startsWith('/api/development/proxy') || path.startsWith('/api/production/proxy') || path.startsWith('/api/frontend')