From 460b0c993add6284342f8986f0e399319a8e8daa Mon Sep 17 00:00:00 2001 From: John Luo Date: Wed, 23 Dec 2015 15:43:05 -0800 Subject: [PATCH] Adding back middleware initialization with options instance. --- .../IISPlatformHandlerMiddlewareExtensions.cs | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.AspNet.IISPlatformHandler/IISPlatformHandlerMiddlewareExtensions.cs b/src/Microsoft.AspNet.IISPlatformHandler/IISPlatformHandlerMiddlewareExtensions.cs index 353082d33e..88b0b67041 100644 --- a/src/Microsoft.AspNet.IISPlatformHandler/IISPlatformHandlerMiddlewareExtensions.cs +++ b/src/Microsoft.AspNet.IISPlatformHandler/IISPlatformHandlerMiddlewareExtensions.cs @@ -43,9 +43,27 @@ namespace Microsoft.AspNet.Builder } var options = new IISPlatformHandlerOptions(); - if (configureOptions != null) + configureOptions(options); + + return app.UseMiddleware(options); + } + + /// + /// Adds middleware for interacting with the IIS HttpPlatformHandler reverse proxy module. + /// This will handle forwarded Windows Authentication, request scheme, remote IPs, etc.. + /// + /// + /// + /// + public static IApplicationBuilder UseIISPlatformHandler(this IApplicationBuilder app, IISPlatformHandlerOptions options) + { + if (app == null) { - configureOptions(options); + throw new ArgumentNullException(nameof(app)); + } + if (options == null) + { + throw new ArgumentNullException(nameof(options)); } return app.UseMiddleware(options);