1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-04-06 01:15:28 +02:00

chore: streaming spike (#8907)

We need this PR to correctly set up CORS for streaming-related endpoints
in our spike and add the flag to our types.

---------

Co-authored-by: kwasniew <kwasniewski.mateusz@gmail.com>
This commit is contained in:
Nuno Góis 2024-12-03 12:15:09 +00:00 committed by GitHub
parent 3879821396
commit 263aad4248
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 1 deletions

View File

@ -112,6 +112,10 @@ export default async function getApp(
`${baseUriPath}/api/frontend*`, `${baseUriPath}/api/frontend*`,
corsOriginMiddleware(services, config), corsOriginMiddleware(services, config),
); );
app.options(
`${baseUriPath}/api/streaming*`,
corsOriginMiddleware(services, config),
);
app.use(baseUriPath, patMiddleware(config, services)); app.use(baseUriPath, patMiddleware(config, services));

View File

@ -59,7 +59,8 @@ export type IFlagKey =
| 'showUserDeviceCount' | 'showUserDeviceCount'
| 'deleteStaleUserSessions' | 'deleteStaleUserSessions'
| 'memorizeStats' | 'memorizeStats'
| 'licensedUsers'; | 'licensedUsers'
| 'streaming';
export type IFlags = Partial<{ [key in IFlagKey]: boolean | Variant }>; export type IFlags = Partial<{ [key in IFlagKey]: boolean | Variant }>;
@ -279,6 +280,10 @@ const flags: IFlags = {
process.env.UNLEASH_EXPERIMENTAL_FLAG_LICENSED_USERS, process.env.UNLEASH_EXPERIMENTAL_FLAG_LICENSED_USERS,
false, false,
), ),
streaming: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_STREAMING,
false,
),
}; };
export const defaultExperimentalOptions: IExperimentalOptions = { export const defaultExperimentalOptions: IExperimentalOptions = {