1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

fix: CORS options path (#2165)

* fix: path

* fix: path typo
This commit is contained in:
Fredrik Strand Oseberg 2022-10-11 09:20:29 +02:00 committed by GitHub
parent 14b802668c
commit b341018b1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -75,7 +75,7 @@ export default async function getApp(
// Preflight requests should not have Authorization headers, // Preflight requests should not have Authorization headers,
// so this must be handled before the API token middleware. // so this must be handled before the API token middleware.
app.options( app.options(
'/api/frontend*', `${baseUriPath}/api/frontend*`,
conditionalMiddleware( conditionalMiddleware(
() => config.flagResolver.isEnabled('embedProxy'), () => config.flagResolver.isEnabled('embedProxy'),
corsOriginMiddleware(services), corsOriginMiddleware(services),

View File

@ -15,7 +15,7 @@ const isProxyApi = ({ path }) => {
// Handle all our current proxy paths which will redirect to the new // Handle all our current proxy paths which will redirect to the new
// embedded proxy endpoint // embedded proxy endpoint
return ( return (
path.startsWith('/api/default/proxy') || path.startsWith('/api/proxy') ||
path.startsWith('/api/development/proxy') || path.startsWith('/api/development/proxy') ||
path.startsWith('/api/production/proxy') || path.startsWith('/api/production/proxy') ||
path.startsWith('/api/frontend') path.startsWith('/api/frontend')