From 1890c136cb777a8c67e2a2b426e205c07f434763 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Chalet?= Date: Tue, 8 Dec 2015 18:44:07 +0100 Subject: [PATCH] React to API changes in aspnet/IISIntegration https://github.com/aspnet/IISIntegration/commit/f8ff2cd6d1a8c8971404dd5273274e30c43be842 --- samples/Mvc.Client/Startup.cs | 5 +++++ samples/Mvc.Client/project.json | 2 +- samples/Mvc.Server/Startup.cs | 5 +++++ samples/Mvc.Server/project.json | 1 + 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/samples/Mvc.Client/Startup.cs b/samples/Mvc.Client/Startup.cs index 1393c243..5e94e6eb 100644 --- a/samples/Mvc.Client/Startup.cs +++ b/samples/Mvc.Client/Startup.cs @@ -2,6 +2,7 @@ using Microsoft.AspNet.Authentication; using Microsoft.AspNet.Authentication.Cookies; using Microsoft.AspNet.Builder; using Microsoft.AspNet.Http; +using Microsoft.AspNet.HttpOverrides; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Microsoft.IdentityModel.Protocols.OpenIdConnect; @@ -26,6 +27,10 @@ namespace Mvc.Client { options.FlowWindowsAuthentication = false; }); + app.UseOverrideHeaders(new OverrideHeaderMiddlewareOptions { + ForwardedOptions = ForwardedHeaders.All + }); + app.UseStaticFiles(); // Insert a new cookies middleware in the pipeline to store the user diff --git a/samples/Mvc.Client/project.json b/samples/Mvc.Client/project.json index 63ab6574..cdf5a48c 100644 --- a/samples/Mvc.Client/project.json +++ b/samples/Mvc.Client/project.json @@ -6,8 +6,8 @@ "Microsoft.AspNet.Authentication.Cookies": "1.0.0-*", "Microsoft.AspNet.Authentication.OpenIdConnect": "1.0.0-*", "Microsoft.AspNet.IISPlatformHandler": "1.0.0-*", + "Microsoft.AspNet.HttpOverrides": "1.0.0-*", "Microsoft.AspNet.Server.Kestrel": "1.0.0-*", - "Microsoft.AspNet.Server.WebListener": "1.0.0-*", "Microsoft.AspNet.StaticFiles": "1.0.0-*", "Microsoft.Extensions.Logging.Console": "1.0.0-*", diff --git a/samples/Mvc.Server/Startup.cs b/samples/Mvc.Server/Startup.cs index 5ebaae33..508c4644 100644 --- a/samples/Mvc.Server/Startup.cs +++ b/samples/Mvc.Server/Startup.cs @@ -1,6 +1,7 @@ using System.Linq; using CryptoHelper; using Microsoft.AspNet.Builder; +using Microsoft.AspNet.HttpOverrides; using Microsoft.AspNet.Identity.EntityFramework; using Microsoft.Data.Entity; using Microsoft.Extensions.Configuration; @@ -44,6 +45,10 @@ namespace Mvc.Server { options.FlowWindowsAuthentication = false; }); + app.UseOverrideHeaders(new OverrideHeaderMiddlewareOptions { + ForwardedOptions = ForwardedHeaders.All + }); + app.UseStaticFiles(); // Add a middleware used to validate access diff --git a/samples/Mvc.Server/project.json b/samples/Mvc.Server/project.json index 1992e0de..ab65b732 100644 --- a/samples/Mvc.Server/project.json +++ b/samples/Mvc.Server/project.json @@ -9,6 +9,7 @@ "Microsoft.AspNet.Authentication.Twitter": "1.0.0-*", "Microsoft.AspNet.Diagnostics": "1.0.0-*", "Microsoft.AspNet.IISPlatformHandler": "1.0.0-*", + "Microsoft.AspNet.HttpOverrides": "1.0.0-*", "Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-*", "Microsoft.AspNet.Server.Kestrel": "1.0.0-*", "Microsoft.AspNet.StaticFiles": "1.0.0-*",