Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Desktop origin includes scheme

Manav Rathi344c5cc399a0
diff --git a/infra/workers/thumbnails/src/index.ts b/infra/workers/thumbnails/src/index.ts
index b2a821d589..105b114257 100644
--- a/infra/workers/thumbnails/src/index.ts
+++ b/infra/workers/thumbnails/src/index.ts
@@ -32,18 +32,18 @@ const handleOPTIONS = (request: Request) => {
};
const isAllowedOrigin = (origin: string | null) => {
- const allowed = [
+ const desktopApp = "ente://app";
+ const allowedHostname = [
"web.ente.io",
"photos.ente.io",
"photos.ente.sh",
"localhost",
- "ente://app" /* Desktop app */,
];
if (!origin) return false;
try {
const url = new URL(origin);
- return allowed.includes(url.hostname);
+ return origin == desktopApp || allowedHostname.includes(url.hostname);
} catch {
// origin is likely an invalid URL
return false;