mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-05-06 16:36:00 +01:00
* Added more test cases and fix system partition key load issue * Fix unit tests and fix ci * Updated test snapsho
24 lines
627 B
TypeScript
24 lines
627 B
TypeScript
import { Page } from "@playwright/test";
|
|
|
|
export async function setupCORSBypass(page: Page) {
|
|
await page.route("**/api/mongo/explorer{,/**}", async (route) => {
|
|
const response = await route.fetch({
|
|
headers: {
|
|
...route.request().headers(),
|
|
},
|
|
});
|
|
|
|
await route.fulfill({
|
|
status: response.status(),
|
|
headers: {
|
|
...response.headers(),
|
|
"Access-Control-Allow-Origin": "*",
|
|
"Access-Control-Allow-Methods": "*",
|
|
"Access-Control-Allow-Headers": "*",
|
|
"Access-Control-Allow-Credentials": "*",
|
|
},
|
|
body: await response.body(),
|
|
});
|
|
});
|
|
}
|