1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-09-17 15:02:34 +02:00

New: Restrict ports that Sonarr will allow for its webserver

This commit is contained in:
Mark McDowall 2015-03-18 23:15:11 -07:00
parent 9dd66879a2
commit 06a2cb0de4

View File

@ -30,7 +30,21 @@ public static IRuleBuilderOptions<T, string> ValidRootUrl<T>(this IRuleBuilder<T
public static IRuleBuilderOptions<T, int> ValidPort<T>(this IRuleBuilder<T, int> ruleBuilder)
{
return ruleBuilder.SetValidator(new InclusiveBetweenValidator(1, 65535));
return ruleBuilder.SetValidator(new InclusiveBetweenValidator(1, 65535))
.Must(x =>
{
if (x <= 1024)
{
if (x == 80 || x == 443)
{
return true;
}
return false;
}
return true;
});
}
public static IRuleBuilderOptions<T, Language> ValidLanguage<T>(this IRuleBuilder<T, Language> ruleBuilder)