diff --git a/NzbDrone.Api/FrontendModule/IndexModule.cs b/NzbDrone.Api/FrontendModule/IndexModule.cs index 0ca2cae38..a89a18e5d 100644 --- a/NzbDrone.Api/FrontendModule/IndexModule.cs +++ b/NzbDrone.Api/FrontendModule/IndexModule.cs @@ -1,5 +1,7 @@ -using System.Linq; +using System; +using System.Linq; using Nancy; +using Nancy.Responses.Negotiation; namespace NzbDrone.Api.FrontendModule { @@ -7,7 +9,22 @@ namespace NzbDrone.Api.FrontendModule { public IndexModule() { - Get[@"/"] = x => View["NzbDrone.Backbone/index.html"]; + //Serve anything that doesn't have an extension + Get[@"/(.*)"] = x => Index(); + } + + private object Index() + { + if( + Request.Path.Contains(".") + || Request.Path.StartsWith("/static", StringComparison.CurrentCultureIgnoreCase) + || Request.Path.StartsWith("/api", StringComparison.CurrentCultureIgnoreCase)) + { + return new NotFoundResponse(); + } + + + return View["NzbDrone.Backbone/index.html"]; } } } \ No newline at end of file diff --git a/NzbDrone.Backbone/Index.html b/NzbDrone.Backbone/Index.html index f5e6ac95e..74e6300a3 100644 --- a/NzbDrone.Backbone/Index.html +++ b/NzbDrone.Backbone/Index.html @@ -9,14 +9,25 @@ - - - - + + + + - + -S +