diff --git a/src/NzbDrone.Api/Config/HostConfigModule.cs b/src/NzbDrone.Api/Config/HostConfigModule.cs
index c0e99d265..37821bfbe 100644
--- a/src/NzbDrone.Api/Config/HostConfigModule.cs
+++ b/src/NzbDrone.Api/Config/HostConfigModule.cs
@@ -42,6 +42,9 @@ namespace NzbDrone.Api.Config
.ValidIp4Address()
.NotListenAllIp4Address()
.When(c => c.BindAddress != "*");
+
+ SharedValidator.RuleFor(c => c.UrlBase)
+ .ValidUrlBase();
}
private HostConfigResource GetHostConfig()
diff --git a/src/NzbDrone.Core/NzbDrone.Core.csproj b/src/NzbDrone.Core/NzbDrone.Core.csproj
index db97f7e3e..2f1bac1f2 100644
--- a/src/NzbDrone.Core/NzbDrone.Core.csproj
+++ b/src/NzbDrone.Core/NzbDrone.Core.csproj
@@ -84,7 +84,7 @@
False
..\packages\RestSharp.105.0.1\lib\net4\RestSharp.dll
-
+
False
..\packages\xmlrpcnet.2.5.0\lib\net20\CookComputing.XmlRpcV2.dll
@@ -997,4 +997,4 @@
-->
-
+
\ No newline at end of file
diff --git a/src/NzbDrone.Core/Validation/RuleBuilderExtensions.cs b/src/NzbDrone.Core/Validation/RuleBuilderExtensions.cs
index ade8f810b..d8207ee76 100644
--- a/src/NzbDrone.Core/Validation/RuleBuilderExtensions.cs
+++ b/src/NzbDrone.Core/Validation/RuleBuilderExtensions.cs
@@ -62,5 +62,10 @@ namespace NzbDrone.Core.Validation
{
return ruleBuilder.WithState(v => NzbDroneValidationState.Warning);
}
+
+ public static IRuleBuilderOptions ValidUrlBase(this IRuleBuilder ruleBuilder)
+ {
+ return ruleBuilder.SetValidator(new RegularExpressionValidator(@"^(?!\/?https?://[-a-z0-9.]+)", RegexOptions.IgnoreCase)).WithMessage("Must be a valid URL path (ie: '/sonarr')");
+ }
}
}
\ No newline at end of file