fix: Resolve the issue of QR code sharing files not being able to download (#12485)

This commit is contained in:
2026-04-14 15:12:44 +08:00
committed by GitHub
parent 6dc218cf80
commit 8362578355

View File

@@ -30,6 +30,16 @@ func Init() {
}
LocalAgentProxy = &httputil.ReverseProxy{
Director: func(req *http.Request) {
if req.Header.Get("X-Forwarded-Proto") == "" {
if req.TLS != nil {
req.Header.Set("X-Forwarded-Proto", "https")
} else {
req.Header.Set("X-Forwarded-Proto", "http")
}
}
if req.Header.Get("X-Forwarded-Host") == "" && req.Host != "" {
req.Header.Set("X-Forwarded-Host", req.Host)
}
req.URL.Scheme = "http"
req.URL.Host = "unix"
},