Skip to content

Commit 7dd7ec7

Browse files
committed
fix: disable compression for Range requests to prevent conflicts with servers/CDNs
1 parent 3c4f361 commit 7dd7ec7

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

routes/video.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,10 @@ func processVideoProxy(c *fiber.Ctx, logger *zap.Logger, cache *ristretto.Cache[
456456
// Forward Range header if present
457457
if rangeHeader != "" {
458458
req.Header.Set("Range", rangeHeader)
459+
// Disable compression for Range requests to prevent conflicts
460+
// When Accept-Encoding: gzip is sent with Range header, some servers/CDNs
461+
// may ignore the Range header or behave incorrectly
462+
req.Header.Set("Accept-Encoding", "identity")
459463
}
460464

461465
resp, err := client.GetHTTPClient().Do(req)

0 commit comments

Comments
 (0)