test
Some checks are pending
CI / build (push) Waiting to run

This commit is contained in:
Fijxu 2024-12-21 14:53:33 -03:00
parent e28d86018e
commit b156a52420
Signed by: Fijxu
GPG key ID: 32C1DDF333EDA6A4

View file

@ -216,13 +216,12 @@ func vi(w http.ResponseWriter, req *http.Request) {
proxyURL.RawQuery = q.Encode() proxyURL.RawQuery = q.Encode()
request, err := http.NewRequest(req.Method, proxyURL.String(), nil) request, err := http.NewRequest(req.Method, proxyURL.String(), nil)
copyHeaders(req.Header, request.Header, false)
request.Header.Set("User-Agent", default_ua)
if err != nil { if err != nil {
log.Panic(err) log.Panic(err)
} }
request.Header.Set("User-Agent", default_ua)
resp, err := client.Do(request) resp, err := client.Do(request)
if err != nil { if err != nil {
log.Panic(err) log.Panic(err)
@ -236,8 +235,8 @@ func vi(w http.ResponseWriter, req *http.Request) {
defer resp.Body.Close() defer resp.Body.Close()
NoRewrite := strings.HasPrefix(resp.Header.Get("Content-Type"), "audio") || strings.HasPrefix(resp.Header.Get("Content-Type"), "video") // NoRewrite := strings.HasPrefix(resp.Header.Get("Content-Type"), "audio") || strings.HasPrefix(resp.Header.Get("Content-Type"), "video")
copyHeaders(resp.Header, w.Header(), NoRewrite) // copyHeaders(resp.Header, w.Header(), NoRewrite)
w.WriteHeader(resp.StatusCode) w.WriteHeader(resp.StatusCode)
io.Copy(w, resp.Body) io.Copy(w, resp.Body)