π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Tweaks
Manav Rathi562313b218c6
diff --git a/infra/workers/cast-albums/src/index.ts b/infra/workers/cast-albums/src/index.tsindex d76c333755..8ca3d66bec 100644--- a/infra/workers/cast-albums/src/index.ts+++ b/infra/workers/cast-albums/src/index.ts@@ -8,25 +8,24 @@ export default {case "OPTIONS":return handleOPTIONS(request);default:- throw new Error(- `HTTP 405 Method Not Allowed: ${request.method}`- );+ throw new Error(`Unsupported HTTP method ${request.method}`);}},} satisfies ExportedHandler;const handleGET = async (request: Request) => {const url = new URL(request.url);- const urlParams = new URLSearchParams(url.search);- const token =+ const castToken =request.headers.get("X-Cast-Access-Token") ??- urlParams.get("castToken");+ url.searchParams.get("castToken");+ if (!castToken) throw new Error("No cast token provided");- const fileID = urlParams.get("fileID");+ const fileID = url.searchParams.get("fileID");const pathname = url.pathname;+ const params = new URLSearchParams({ castToken });let response = await fetch(- `https://api.ente.io/cast/files${pathname}${fileID}?castToken=${token}`+ `https://api.ente.io/cast/files${pathname}${fileID}?${params.toString()}`);response = new Response(response.body, response);@@ -37,7 +36,7 @@ const handleGET = async (request: Request) => {const handleOPTIONS = (request: Request) => {let corsHeaders: Record<string, string> = {"Access-Control-Allow-Origin": "*",- "Access-Control-Allow-Methods": "GET,OPTIONS",+ "Access-Control-Allow-Methods": "GET, OPTIONS","Access-Control-Max-Age": "86400",};