diff --git a/CHANGELOG.md b/CHANGELOG.md index 75856027..07d786bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/TrashLib/Extensions/FlurlLogging.cs b/src/TrashLib/Extensions/FlurlLogging.cs index ee15f10d..92065abb 100644 --- a/src/TrashLib/Extensions/FlurlLogging.cs +++ b/src/TrashLib/Extensions/FlurlLogging.cs @@ -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; + }; } }