mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 18:58:26 +00:00
Allowlist play.ty.dev (#17857)
This commit is contained in:
parent
24d3fc27fb
commit
7f50b503cf
1 changed files with 6 additions and 2 deletions
|
@ -31,7 +31,11 @@ const PRODUCTION_HEADERS = {
|
|||
"Access-Control-Allow-Origin": "https://play.ruff.rs",
|
||||
};
|
||||
|
||||
const ALLOWED_DOMAINS = ["https://playknot.ruff.rs", "https://types.ruff.rs"];
|
||||
const ALLOWED_DOMAINS = new Set([
|
||||
"https://playknot.ruff.rs",
|
||||
"https://types.ruff.rs",
|
||||
"https://play.ty.dev",
|
||||
]);
|
||||
|
||||
export default {
|
||||
async fetch(
|
||||
|
@ -45,7 +49,7 @@ export default {
|
|||
|
||||
if (!DEV) {
|
||||
const origin = request.headers.get("origin");
|
||||
if (origin && ALLOWED_DOMAINS.includes(origin)) {
|
||||
if (origin && ALLOWED_DOMAINS.has(origin)) {
|
||||
headers["Access-Control-Allow-Origin"] = origin;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue