From 910794d831f03286e8ce2264bcd6ea1a7177dad9 Mon Sep 17 00:00:00 2001 From: Ingo Oppermann Date: Wed, 6 Dec 2023 14:30:42 +0100 Subject: [PATCH] Ignore range request on m3u8 rewrite If a m3u8 is requested with a range request and gets rewritten, e.g. adding the sessionid, the announced content-range may not correspond to the content-length. In this cases the range request is ignored and the full m3u8 will be returned. --- http/middleware/session/HLS.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/http/middleware/session/HLS.go b/http/middleware/session/HLS.go index 4883815d..6e2ad5c4 100644 --- a/http/middleware/session/HLS.go +++ b/http/middleware/session/HLS.go @@ -154,6 +154,10 @@ func (h *handler) handleHLSEgress(c echo.Context, ctxuser string, data map[strin } } + // Remove any Range request headers, because the rewrite will mess up any lengths. + req.Header.Del("Range") + req.Header.Del("If-Range") + rewrite = true }