mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
@@ -42,6 +42,9 @@ namespace NzbDrone.Api.Config
|
|||||||
.ValidIp4Address()
|
.ValidIp4Address()
|
||||||
.NotListenAllIp4Address()
|
.NotListenAllIp4Address()
|
||||||
.When(c => c.BindAddress != "*");
|
.When(c => c.BindAddress != "*");
|
||||||
|
|
||||||
|
SharedValidator.RuleFor(c => c.UrlBase)
|
||||||
|
.ValidUrlBase();
|
||||||
}
|
}
|
||||||
|
|
||||||
private HostConfigResource GetHostConfig()
|
private HostConfigResource GetHostConfig()
|
||||||
|
@@ -62,5 +62,10 @@ namespace NzbDrone.Core.Validation
|
|||||||
{
|
{
|
||||||
return ruleBuilder.WithState(v => NzbDroneValidationState.Warning);
|
return ruleBuilder.WithState(v => NzbDroneValidationState.Warning);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static IRuleBuilderOptions<T, string> ValidUrlBase<T>(this IRuleBuilder<T, string> ruleBuilder)
|
||||||
|
{
|
||||||
|
return ruleBuilder.SetValidator(new RegularExpressionValidator(@"^(?!\/?https?://[-a-z0-9.]+)", RegexOptions.IgnoreCase)).WithMessage("Must be a valid URL path (ie: '/sonarr')");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user