From 1631c1877c4f90663a52457ab8dc9c45a482c97c Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Wed, 18 Sep 2013 23:55:13 -0700 Subject: [PATCH] upgraded to nancy 20 --- NzbDrone.Api/NzbDrone.Api.csproj | 11 ++++++----- NzbDrone.Api/packages.config | 4 ++-- NzbDrone.Host/NzbDrone.Host.csproj | 9 +++++---- NzbDrone.Host/Owin/MiddleWare/NancyMiddleWare.cs | 14 ++++++++------ NzbDrone.Host/packages.config | 4 ++-- .../NzbDrone.Integration.Test.csproj | 8 ++++---- NzbDrone.Integration.Test/packages.config | 4 ++-- 7 files changed, 29 insertions(+), 25 deletions(-) diff --git a/NzbDrone.Api/NzbDrone.Api.csproj b/NzbDrone.Api/NzbDrone.Api.csproj index a4fb4ee50..331591808 100644 --- a/NzbDrone.Api/NzbDrone.Api.csproj +++ b/NzbDrone.Api/NzbDrone.Api.csproj @@ -46,12 +46,13 @@ False ..\packages\Microsoft.AspNet.SignalR.Core.1.1.3\lib\net40\Microsoft.AspNet.SignalR.Core.dll - - ..\packages\Nancy.0.18.0\lib\net40\Nancy.dll + + False + ..\packages\Nancy.0.20.0\lib\net40\Nancy.dll - + False - ..\packages\Nancy.Authentication.Basic.0.18.0\lib\net40\Nancy.Authentication.Basic.dll + ..\packages\Nancy.Authentication.Basic.0.20.0\lib\net40\Nancy.Authentication.Basic.dll False @@ -190,4 +191,4 @@ --> - + \ No newline at end of file diff --git a/NzbDrone.Api/packages.config b/NzbDrone.Api/packages.config index dff31468c..722ec5a8b 100644 --- a/NzbDrone.Api/packages.config +++ b/NzbDrone.Api/packages.config @@ -2,8 +2,8 @@ - - + + diff --git a/NzbDrone.Host/NzbDrone.Host.csproj b/NzbDrone.Host/NzbDrone.Host.csproj index 7ecf58a13..71a3643d6 100644 --- a/NzbDrone.Host/NzbDrone.Host.csproj +++ b/NzbDrone.Host/NzbDrone.Host.csproj @@ -89,12 +89,13 @@ False ..\packages\Microsoft.Owin.Hosting.1.1.0-beta2\lib\net40\Microsoft.Owin.Hosting.dll - - ..\packages\Nancy.0.18.0\lib\net40\Nancy.dll + + False + ..\packages\Nancy.0.20.0\lib\net40\Nancy.dll - + False - ..\packages\Nancy.Owin.0.18.0\lib\net40\Nancy.Owin.dll + ..\packages\Nancy.Owin.0.20.0\lib\net40\Nancy.Owin.dll False diff --git a/NzbDrone.Host/Owin/MiddleWare/NancyMiddleWare.cs b/NzbDrone.Host/Owin/MiddleWare/NancyMiddleWare.cs index 54fc516d8..9e74c1e71 100644 --- a/NzbDrone.Host/Owin/MiddleWare/NancyMiddleWare.cs +++ b/NzbDrone.Host/Owin/MiddleWare/NancyMiddleWare.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Nancy.Bootstrapper; +using Nancy.Bootstrapper; using Nancy.Owin; using Owin; @@ -20,8 +17,13 @@ namespace NzbDrone.Host.Owin.MiddleWare public void Attach(IAppBuilder appBuilder) { - var nancyOwinHost = new NancyOwinHost(null, _nancyBootstrapper, new HostConfiguration()); - appBuilder.Use((Func, Task>, Func, Task>>)(next => (Func, Task>)nancyOwinHost.Invoke), new object[0]); + var options = new NancyOptions + { + Bootstrapper = _nancyBootstrapper, + PerformPassThrough = context => context.Request.Path.StartsWith("/signalr") + }; + + appBuilder.UseNancy(options); } } } \ No newline at end of file diff --git a/NzbDrone.Host/packages.config b/NzbDrone.Host/packages.config index 36d7e82de..f134e38ed 100644 --- a/NzbDrone.Host/packages.config +++ b/NzbDrone.Host/packages.config @@ -5,8 +5,8 @@ - - + + diff --git a/NzbDrone.Integration.Test/NzbDrone.Integration.Test.csproj b/NzbDrone.Integration.Test/NzbDrone.Integration.Test.csproj index 9bba4d240..10d08e97d 100644 --- a/NzbDrone.Integration.Test/NzbDrone.Integration.Test.csproj +++ b/NzbDrone.Integration.Test/NzbDrone.Integration.Test.csproj @@ -59,13 +59,13 @@ False ..\packages\Moq.4.0.10827\lib\NET40\Moq.dll - + False - ..\packages\Nancy.0.18.0\lib\net40\Nancy.dll + ..\packages\Nancy.0.20.0\lib\net40\Nancy.dll - + False - ..\packages\Nancy.Owin.0.18.0\lib\net40\Nancy.Owin.dll + ..\packages\Nancy.Owin.0.20.0\lib\net40\Nancy.Owin.dll False diff --git a/NzbDrone.Integration.Test/packages.config b/NzbDrone.Integration.Test/packages.config index 268fde156..7a828fde8 100644 --- a/NzbDrone.Integration.Test/packages.config +++ b/NzbDrone.Integration.Test/packages.config @@ -7,8 +7,8 @@ - - + +