fix: prevent encoding issues by removing problematic headers in relay responses

This commit is contained in:
MythEclipse
2026-05-07 22:25:39 +07:00
parent 1a0a947674
commit f691476046
2 changed files with 6 additions and 0 deletions
+3
View File
@@ -90,11 +90,14 @@ export function isAllowedTarget(url: string): boolean {
export function createRelayResponse(response: Response): Response {
const headers = new Headers(response.headers);
// Remove headers that would confuse the browser or were handled by the proxy
headers.delete("content-encoding");
headers.delete("content-length");
headers.delete("transfer-encoding");
headers.delete("connection");
headers.delete("keep-alive");
headers.delete("x-frame-options"); // Allow embedding if needed
headers.delete("content-security-policy");
// Add CORS for browser UI
headers.set("Access-Control-Allow-Origin", "*");