mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-01-25 20:54:18 +00:00
Fix CORS issue using Mongo Shell from new origin (#1422)
* Fix CORS issue using Mongo Shell from new origin * Add unit tests for getMongoShellOrigin and getMongoShellUrl * Fix lint errors
This commit is contained in:
committed by
GitHub
parent
9d2d0e4754
commit
874cec26fc
15
src/Explorer/Tabs/MongoShellTab/getMongoShellOrigin.ts
Normal file
15
src/Explorer/Tabs/MongoShellTab/getMongoShellOrigin.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { configContext } from "../../../ConfigContext";
|
||||
import { userContext } from "../../../UserContext";
|
||||
|
||||
export function getMongoShellOrigin(): string {
|
||||
if (
|
||||
userContext.features.enableLegacyMongoShellV1 === true ||
|
||||
userContext.features.enableLegacyMongoShellV2 === true ||
|
||||
userContext.features.enableLegacyMongoShellV1Dist === true ||
|
||||
userContext.features.enableLegacyMongoShellV2Dist === true
|
||||
) {
|
||||
return window.origin;
|
||||
}
|
||||
|
||||
return configContext.BACKEND_ENDPOINT;
|
||||
}
|
||||
Reference in New Issue
Block a user