fix: Prevent redirects

I observed that when the user specifies an invalid URL to their Radarr
or Sonarr instance (such as forgetting to use the Base URL), it attempts
to redirect by returning HTTP 300. This is now prevented and a warning
is printed to output.
pull/47/head
Robert Dailey 2 years ago
parent 95b37ba498
commit 7a419e26ce

@ -8,6 +8,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### Changed
- Do not follow HTTP redirects and instead issue a warning to the user that they are potentially
using the wrong URL.
## [1.8.2] - 2022-03-06
### Fixed

@ -22,5 +22,13 @@ public static class FlurlLogging
var url = urlInterceptor(call.Request.Url.Clone());
log.Debug("HTTP Response {Status} from {Url}", statusCode, url);
};
settings.OnRedirect = call =>
{
log.Warning("HTTP Redirect received; this indicates a problem with your URL and/or reverse proxy: {Url}",
call.Redirect.Url);
call.Redirect.Follow = false;
};
}
}

Loading…
Cancel
Save