From 55c5cd0a7c17ee9a73b1b0dab274d97654446f24 Mon Sep 17 00:00:00 2001 From: Abdullah Atta Date: Fri, 20 Mar 2026 12:35:36 +0500 Subject: [PATCH] cors: fix youtube embeds not working on mobile --- cors-proxy/src/index.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cors-proxy/src/index.ts b/cors-proxy/src/index.ts index 74196be..9e801a6 100644 --- a/cors-proxy/src/index.ts +++ b/cors-proxy/src/index.ts @@ -39,7 +39,7 @@ function isValidUrl(urlString: string): boolean { // Handle proxied request with redirect support async function proxyRequest( targetUrl: string, - redirectCount = 0 + redirectCount = 0, ): Promise { if (redirectCount >= MAX_REDIRECTS) { return new Response("Too many redirects", { @@ -147,7 +147,7 @@ const server = Bun.serve({ method2: "GET /?url=", example1: `${url.origin}/https://example.com/image.jpg`, example2: `${url.origin}/?url=${encodeURIComponent( - "https://example.com/image.jpg" + "https://example.com/image.jpg", )}`, }, endpoints: { @@ -190,7 +190,7 @@ const server = Bun.serve({ { status: 400, headers: corsHeaders, - } + }, ); } @@ -218,7 +218,7 @@ const server = Bun.serve({ status: 200, headers: { "Content-Type": "text/html; charset=utf-8", - "Content-Security-Policy": "frame-ancestors *", + // "Content-Security-Policy": "frame-ancestors *", "X-Frame-Options": "ALLOWALL", }, }); @@ -239,7 +239,7 @@ const server = Bun.serve({ }); console.log( - `🚀 CORS Proxy Server running on http://${server.hostname}:${server.port}` + `🚀 CORS Proxy Server running on http://${server.hostname}:${server.port}`, ); console.log(`📋 Health check: http://${server.hostname}:${server.port}/health`); console.log(`🌍 Environment: ${Bun.env.NODE_ENV || "development"}`); @@ -280,7 +280,7 @@ function serveYouTubeEmbed(url: string) { `;