Revert 848ad555f7
and 939f4da3f7
All checks were successful
CI / build (push) Successful in 4m45s
All checks were successful
CI / build (push) Successful in 4m45s
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
This commit is contained in:
parent
848ad555f7
commit
d225323628
1 changed files with 11 additions and 11 deletions
22
main.go
22
main.go
|
@ -330,17 +330,17 @@ func beforeProxy(next http.HandlerFunc) http.HandlerFunc {
|
||||||
// Only allow requests from origin inv.nadeko.net
|
// Only allow requests from origin inv.nadeko.net
|
||||||
// Why? Because I don't want anyone to use this proxy for their own purposes.
|
// Why? Because I don't want anyone to use this proxy for their own purposes.
|
||||||
// Hardcoded because I'm lazy lol!
|
// Hardcoded because I'm lazy lol!
|
||||||
origin := req.Header.Get("Origin")
|
// origin := req.Header.Get("Origin")
|
||||||
if origin == "https://inv.nadeko.net" || origin == "https://materialious.nadeko.net" {
|
// if origin == "https://inv.nadeko.net" || origin == "https://materialious.nadeko.net" {
|
||||||
w.Header().Set("Access-Control-Allow-Origin", "*")
|
w.Header().Set("Access-Control-Allow-Origin", "*")
|
||||||
w.Header().Set("Access-Control-Allow-Headers", "*")
|
w.Header().Set("Access-Control-Allow-Headers", "*")
|
||||||
w.Header().Set("Access-Control-Allow-Methods", "GET, HEAD, OPTIONS")
|
w.Header().Set("Access-Control-Allow-Methods", "GET, HEAD, OPTIONS")
|
||||||
w.Header().Set("Access-Control-Max-Age", "1728000")
|
w.Header().Set("Access-Control-Max-Age", "1728000")
|
||||||
} else {
|
// } else {
|
||||||
w.WriteHeader(401)
|
// w.WriteHeader(401)
|
||||||
io.WriteString(w, "Only requests coming from inv.nadeko.net are allowed.")
|
// io.WriteString(w, "Only requests coming from inv.nadeko.net are allowed.")
|
||||||
return
|
// return
|
||||||
}
|
// }
|
||||||
|
|
||||||
if h3s {
|
if h3s {
|
||||||
w.Header().Set("Alt-Svc", "h3=\":8443\"; ma=86400")
|
w.Header().Set("Alt-Svc", "h3=\":8443\"; ma=86400")
|
||||||
|
|
Loading…
Reference in a new issue