Add headers to look like a browser
All checks were successful
CI / build (push) Successful in 4m1s

This commit is contained in:
Fijxu 2024-10-30 03:08:24 -03:00
parent a37a1a5ff1
commit 188e007dfd
Signed by: Fijxu
GPG key ID: 32C1DDF333EDA6A4

View file

@ -174,6 +174,15 @@ func beforeAll(next http.HandlerFunc) http.HandlerFunc {
atomic.AddInt64(&stats_.RequestCount, 1)
// Too look like more like a browser
req.Header.Add("Origin", "https://www.youtube.com")
req.Header.Add("Pargma", "no-cache")
req.Header.Add("Priority", "u=1, i")
req.Header.Add("Referer", "https://www.youtube.com/")
req.Header.Add("sec-fetch-dest", "empty")
req.Header.Add("sec-fetch-mode", "cors")
req.Header.Add("sec-fetch-site", "cross-site")
w.Header().Set("Access-Control-Allow-Origin", "*")
w.Header().Set("Access-Control-Allow-Headers", "*")
w.Header().Set("Access-Control-Max-Age", "1728000")