plex: Stop after 10 redirects

Since the default CheckRedirect has been replaced with ours, we won't get the default protection of erroring after 10 redirects, so i've copied that back in from the std implementation
This commit is contained in:
IRHM
2026-07-26 02:25:34 +01:00
committed by momi
parent 4e6e71687b
commit 9d5e489675
+3
View File
@@ -345,6 +345,9 @@ var plexHTTPClient = &http.Client{
if len(via) == 0 {
return nil
}
if len(via) >= 10 {
return errors.New("stopped after 10 redirects")
}
if req.URL.Host != via[0].URL.Host {
req.Header.Del("X-Plex-Token")
}