From d2253236282d556ddc5ea7c382dc03c2a1042806 Mon Sep 17 00:00:00 2001 From: Fijxu Date: Wed, 13 Nov 2024 21:55:01 -0300 Subject: [PATCH] Revert 848ad555f7663ab5da418c8644bc18983439473f and 939f4da3f74ccfc81a885d5e3d6341756b3a84e6 If the user on Invidious uses HD720, the playback is broken becuase the "Origin" header is not sent (unknown reason). This also appears to break third party clients like Clipious. I'm retarted sorry n.n --- main.go | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/main.go b/main.go index 619cbaa..c41d6b2 100644 --- a/main.go +++ b/main.go @@ -330,17 +330,17 @@ func beforeProxy(next http.HandlerFunc) http.HandlerFunc { // Only allow requests from origin inv.nadeko.net // Why? Because I don't want anyone to use this proxy for their own purposes. // Hardcoded because I'm lazy lol! - origin := req.Header.Get("Origin") - if origin == "https://inv.nadeko.net" || origin == "https://materialious.nadeko.net" { - w.Header().Set("Access-Control-Allow-Origin", "*") - w.Header().Set("Access-Control-Allow-Headers", "*") - w.Header().Set("Access-Control-Allow-Methods", "GET, HEAD, OPTIONS") - w.Header().Set("Access-Control-Max-Age", "1728000") - } else { - w.WriteHeader(401) - io.WriteString(w, "Only requests coming from inv.nadeko.net are allowed.") - return - } + // origin := req.Header.Get("Origin") + // if origin == "https://inv.nadeko.net" || origin == "https://materialious.nadeko.net" { + w.Header().Set("Access-Control-Allow-Origin", "*") + w.Header().Set("Access-Control-Allow-Headers", "*") + w.Header().Set("Access-Control-Allow-Methods", "GET, HEAD, OPTIONS") + w.Header().Set("Access-Control-Max-Age", "1728000") + // } else { + // w.WriteHeader(401) + // io.WriteString(w, "Only requests coming from inv.nadeko.net are allowed.") + // return + // } if h3s { w.Header().Set("Alt-Svc", "h3=\":8443\"; ma=86400")