Fixed: Handle 307 redirects from applications

pull/2235/head
Bogdan 4 months ago
parent 11d58b4460
commit aee3f2d12b

@ -64,6 +64,7 @@ namespace NzbDrone.Core.Applications.Lidarr
failures.AddIfNotNull(new ValidationFailure("ProwlarrUrl", "Prowlarr URL is invalid, Lidarr cannot connect to Prowlarr")); failures.AddIfNotNull(new ValidationFailure("ProwlarrUrl", "Prowlarr URL is invalid, Lidarr cannot connect to Prowlarr"));
break; break;
case HttpStatusCode.SeeOther: case HttpStatusCode.SeeOther:
case HttpStatusCode.TemporaryRedirect:
_logger.Warn(ex, "Lidarr returned redirect and is invalid"); _logger.Warn(ex, "Lidarr returned redirect and is invalid");
failures.AddIfNotNull(new ValidationFailure("BaseUrl", "Lidarr URL is invalid, Prowlarr cannot connect to Lidarr - are you missing a URL base?")); failures.AddIfNotNull(new ValidationFailure("BaseUrl", "Lidarr URL is invalid, Prowlarr cannot connect to Lidarr - are you missing a URL base?"));
break; break;

@ -166,6 +166,7 @@ namespace NzbDrone.Core.Applications.Lidarr
_logger.Error(ex, "Invalid Request"); _logger.Error(ex, "Invalid Request");
break; break;
case HttpStatusCode.SeeOther: case HttpStatusCode.SeeOther:
case HttpStatusCode.TemporaryRedirect:
_logger.Warn(ex, "App returned redirect and is invalid. Check App URL"); _logger.Warn(ex, "App returned redirect and is invalid. Check App URL");
break; break;
case HttpStatusCode.NotFound: case HttpStatusCode.NotFound:

@ -64,6 +64,7 @@ namespace NzbDrone.Core.Applications.Radarr
failures.AddIfNotNull(new ValidationFailure("ProwlarrUrl", "Prowlarr URL is invalid, Radarr cannot connect to Prowlarr")); failures.AddIfNotNull(new ValidationFailure("ProwlarrUrl", "Prowlarr URL is invalid, Radarr cannot connect to Prowlarr"));
break; break;
case HttpStatusCode.SeeOther: case HttpStatusCode.SeeOther:
case HttpStatusCode.TemporaryRedirect:
_logger.Warn(ex, "Radarr returned redirect and is invalid"); _logger.Warn(ex, "Radarr returned redirect and is invalid");
failures.AddIfNotNull(new ValidationFailure("BaseUrl", "Radarr URL is invalid, Prowlarr cannot connect to Radarr - are you missing a URL base?")); failures.AddIfNotNull(new ValidationFailure("BaseUrl", "Radarr URL is invalid, Prowlarr cannot connect to Radarr - are you missing a URL base?"));
break; break;

@ -179,6 +179,7 @@ namespace NzbDrone.Core.Applications.Radarr
_logger.Error(ex, "Invalid Request"); _logger.Error(ex, "Invalid Request");
break; break;
case HttpStatusCode.SeeOther: case HttpStatusCode.SeeOther:
case HttpStatusCode.TemporaryRedirect:
_logger.Warn(ex, "App returned redirect and is invalid. Check App URL"); _logger.Warn(ex, "App returned redirect and is invalid. Check App URL");
break; break;
case HttpStatusCode.NotFound: case HttpStatusCode.NotFound:

@ -64,6 +64,7 @@ namespace NzbDrone.Core.Applications.Readarr
failures.AddIfNotNull(new ValidationFailure("ProwlarrUrl", "Prowlarr URL is invalid, Readarr cannot connect to Prowlarr")); failures.AddIfNotNull(new ValidationFailure("ProwlarrUrl", "Prowlarr URL is invalid, Readarr cannot connect to Prowlarr"));
break; break;
case HttpStatusCode.SeeOther: case HttpStatusCode.SeeOther:
case HttpStatusCode.TemporaryRedirect:
_logger.Warn(ex, "Readarr returned redirect and is invalid"); _logger.Warn(ex, "Readarr returned redirect and is invalid");
failures.AddIfNotNull(new ValidationFailure("BaseUrl", "Readarr URL is invalid, Prowlarr cannot connect to Readarr - are you missing a URL base?")); failures.AddIfNotNull(new ValidationFailure("BaseUrl", "Readarr URL is invalid, Prowlarr cannot connect to Readarr - are you missing a URL base?"));
break; break;

@ -153,6 +153,7 @@ namespace NzbDrone.Core.Applications.Readarr
_logger.Error(ex, "Invalid Request"); _logger.Error(ex, "Invalid Request");
break; break;
case HttpStatusCode.SeeOther: case HttpStatusCode.SeeOther:
case HttpStatusCode.TemporaryRedirect:
_logger.Warn(ex, "App returned redirect and is invalid. Check App URL"); _logger.Warn(ex, "App returned redirect and is invalid. Check App URL");
break; break;
case HttpStatusCode.NotFound: case HttpStatusCode.NotFound:

@ -64,6 +64,7 @@ namespace NzbDrone.Core.Applications.Sonarr
failures.AddIfNotNull(new ValidationFailure("ProwlarrUrl", "Prowlarr URL is invalid, Sonarr cannot connect to Prowlarr")); failures.AddIfNotNull(new ValidationFailure("ProwlarrUrl", "Prowlarr URL is invalid, Sonarr cannot connect to Prowlarr"));
break; break;
case HttpStatusCode.SeeOther: case HttpStatusCode.SeeOther:
case HttpStatusCode.TemporaryRedirect:
_logger.Warn(ex, "Sonarr returned redirect and is invalid"); _logger.Warn(ex, "Sonarr returned redirect and is invalid");
failures.AddIfNotNull(new ValidationFailure("BaseUrl", "Sonarr URL is invalid, Prowlarr cannot connect to Sonarr - are you missing a URL base?")); failures.AddIfNotNull(new ValidationFailure("BaseUrl", "Sonarr URL is invalid, Prowlarr cannot connect to Sonarr - are you missing a URL base?"));
break; break;

@ -166,6 +166,7 @@ namespace NzbDrone.Core.Applications.Sonarr
_logger.Error(ex, "Invalid Request"); _logger.Error(ex, "Invalid Request");
break; break;
case HttpStatusCode.SeeOther: case HttpStatusCode.SeeOther:
case HttpStatusCode.TemporaryRedirect:
_logger.Warn(ex, "App returned redirect and is invalid. Check App URL"); _logger.Warn(ex, "App returned redirect and is invalid. Check App URL");
break; break;
case HttpStatusCode.NotFound: case HttpStatusCode.NotFound:

@ -64,6 +64,7 @@ namespace NzbDrone.Core.Applications.Whisparr
failures.AddIfNotNull(new ValidationFailure("ProwlarrUrl", "Prowlarr URL is invalid, Whisparr cannot connect to Prowlarr")); failures.AddIfNotNull(new ValidationFailure("ProwlarrUrl", "Prowlarr URL is invalid, Whisparr cannot connect to Prowlarr"));
break; break;
case HttpStatusCode.SeeOther: case HttpStatusCode.SeeOther:
case HttpStatusCode.TemporaryRedirect:
_logger.Warn(ex, "Whisparr returned redirect and is invalid"); _logger.Warn(ex, "Whisparr returned redirect and is invalid");
failures.AddIfNotNull(new ValidationFailure("BaseUrl", "Whisparr URL is invalid, Prowlarr cannot connect to Whisparr - are you missing a URL base?")); failures.AddIfNotNull(new ValidationFailure("BaseUrl", "Whisparr URL is invalid, Prowlarr cannot connect to Whisparr - are you missing a URL base?"));
break; break;

@ -151,6 +151,7 @@ namespace NzbDrone.Core.Applications.Whisparr
_logger.Error(ex, "Invalid Request"); _logger.Error(ex, "Invalid Request");
break; break;
case HttpStatusCode.SeeOther: case HttpStatusCode.SeeOther:
case HttpStatusCode.TemporaryRedirect:
_logger.Warn(ex, "App returned redirect and is invalid. Check App URL"); _logger.Warn(ex, "App returned redirect and is invalid. Check App URL");
break; break;
case HttpStatusCode.NotFound: case HttpStatusCode.NotFound:

Loading…
Cancel
Save