fix(cors): origin on all subdomains
All checks were successful
ci / docker (push) Successful in 4m21s

This commit is contained in:
Tine 2024-10-13 18:05:07 +02:00
parent 9082287ad3
commit e97a911fbe
Signed by: mentos1386
SSH key fingerprint: SHA256:MNtTsLbihYaWF8j1fkOHfkKNlnN1JQfxEU/rBU8nCGw

View file

@ -21,7 +21,12 @@ app.use(
);
// Allow CORS for tjo.space
app.use(cors({ origin: "https://tjo.space" }));
app.use(
cors({
origin: (origin: string) =>
origin.endsWith(".tjo.space") ? origin : "https://tjo.space",
}),
);
// But, /.well-known requests from anywhere.
app.use("/.well-known/*", cors({ origin: "*" }));