Fix issues with headers

This commit is contained in:
Mukhtar Akere
2025-08-05 04:28:38 +01:00
parent ce972779c3
commit d0ae839617
3 changed files with 38 additions and 57 deletions

View File

@@ -227,16 +227,3 @@ func setVideoStreamingHeaders(req *http.Request) {
req.Header.Set("User-Agent", "VideoStream/1.0")
req.Header.Set("Priority", "u=1")
}
func setVideoResponseHeaders(w http.ResponseWriter, resp *http.Response, isRange bool) {
// Copy essential headers from upstream
if contentLength := resp.Header.Get("Content-Length"); contentLength != "" {
w.Header().Set("Content-Length", contentLength)
}
if contentRange := resp.Header.Get("Content-Range"); contentRange != "" && isRange {
w.Header().Set("Content-Range", contentRange)
}
w.WriteHeader(resp.StatusCode)
}