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

fix: proxy api check (#1965)

* fix: proxy api check

* fix: add await

* fix: revert async setup for prehook

* fix: stricter endpoint checks
This commit is contained in:
Fredrik Strand Oseberg 2022-08-26 11:44:12 +02:00 committed by GitHub
parent 12cf71a7cb
commit 1821bb881a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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