mirror of
https://github.com/lidarr/Lidarr
synced 2025-03-16 08:39:36 +00:00
Merge pull request #121 from jabbera/portfix
Don't allow port 0 as a listen port
This commit is contained in:
commit
eb96d62577
2 changed files with 2 additions and 2 deletions
|
@ -24,7 +24,7 @@ namespace NzbDrone.Api.Config
|
||||||
UpdateResource = SaveHostConfig;
|
UpdateResource = SaveHostConfig;
|
||||||
|
|
||||||
SharedValidator.RuleFor(c => c.Branch).NotEmpty().WithMessage("Branch name is required, 'master' is the default");
|
SharedValidator.RuleFor(c => c.Branch).NotEmpty().WithMessage("Branch name is required, 'master' is the default");
|
||||||
SharedValidator.RuleFor(c => c.Port).InclusiveBetween(1, 65535);
|
SharedValidator.RuleFor(c => c.Port).ValidPort();
|
||||||
|
|
||||||
SharedValidator.RuleFor(c => c.Username).NotEmpty().When(c => c.AuthenticationEnabled);
|
SharedValidator.RuleFor(c => c.Username).NotEmpty().When(c => c.AuthenticationEnabled);
|
||||||
SharedValidator.RuleFor(c => c.Password).NotEmpty().When(c => c.AuthenticationEnabled);
|
SharedValidator.RuleFor(c => c.Password).NotEmpty().When(c => c.AuthenticationEnabled);
|
||||||
|
|
|
@ -30,7 +30,7 @@ namespace NzbDrone.Core.Validation
|
||||||
|
|
||||||
public static IRuleBuilderOptions<T, int> ValidPort<T>(this IRuleBuilder<T, int> ruleBuilder)
|
public static IRuleBuilderOptions<T, int> ValidPort<T>(this IRuleBuilder<T, int> ruleBuilder)
|
||||||
{
|
{
|
||||||
return ruleBuilder.SetValidator(new InclusiveBetweenValidator(0, 65535));
|
return ruleBuilder.SetValidator(new InclusiveBetweenValidator(1, 65535));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IRuleBuilderOptions<T, Language> ValidLanguage<T>(this IRuleBuilder<T, Language> ruleBuilder)
|
public static IRuleBuilderOptions<T, Language> ValidLanguage<T>(this IRuleBuilder<T, Language> ruleBuilder)
|
||||||
|
|
Loading…
Add table
Reference in a new issue