@@ -67,6 +67,38 @@ public void ConfigureServices(IServiceCollection serviceCollection)
6767
6868 private async Task BaseDirectory ( HttpContext ctx ) => await ctx . Response . WriteAsync ( AppContext . BaseDirectory ) ;
6969
70+ private async Task IIISEnvironmentFeatureConfig ( HttpContext ctx )
71+ {
72+ var config = ctx . RequestServices . GetService < IConfiguration > ( ) ;
73+
74+ await ctx . Response . WriteAsync ( "IIS Version: " + config [ "IIS_VERSION" ] + Environment . NewLine ) ;
75+ await ctx . Response . WriteAsync ( "ApplicationId: " + config [ "IIS_APPLICATION_ID" ] + Environment . NewLine ) ;
76+ await ctx . Response . WriteAsync ( "Application Path: " + config [ "IIS_PHYSICAL_PATH" ] + Environment . NewLine ) ;
77+ await ctx . Response . WriteAsync ( "Application Virtual Path: " + config [ "IIS_APPLICATION_VIRTUAL_PATH" ] + Environment . NewLine ) ;
78+ await ctx . Response . WriteAsync ( "Application Config Path: " + config [ "IIS_APP_CONFIG_PATH" ] + Environment . NewLine ) ;
79+ await ctx . Response . WriteAsync ( "AppPool ID: " + config [ "IIS_APP_POOL_ID" ] + Environment . NewLine ) ;
80+ await ctx . Response . WriteAsync ( "AppPool Config File: " + config [ "IIS_APP_POOL_CONFIG_FILE" ] + Environment . NewLine ) ;
81+ await ctx . Response . WriteAsync ( "Site ID: " + config [ "IIS_SITE_ID" ] + Environment . NewLine ) ;
82+ await ctx . Response . WriteAsync ( "Site Name: " + config [ "IIS_SITE_NAME" ] ) ;
83+ }
84+
85+ #if ! FORWARDCOMPAT
86+ private async Task IIISEnvironmentFeature ( HttpContext ctx )
87+ {
88+ var envFeature = ctx . RequestServices . GetService < IServer > ( ) . Features . Get < IIISEnvironmentFeature > ( ) ;
89+
90+ await ctx . Response . WriteAsync ( "IIS Version: " + envFeature . IISVersion + Environment . NewLine ) ;
91+ await ctx . Response . WriteAsync ( "ApplicationId: " + envFeature . ApplicationId + Environment . NewLine ) ;
92+ await ctx . Response . WriteAsync ( "Application Path: " + envFeature . ApplicationPhysicalPath + Environment . NewLine ) ;
93+ await ctx . Response . WriteAsync ( "Application Virtual Path: " + envFeature . ApplicationVirtualPath + Environment . NewLine ) ;
94+ await ctx . Response . WriteAsync ( "Application Config Path: " + envFeature . AppConfigPath + Environment . NewLine ) ;
95+ await ctx . Response . WriteAsync ( "AppPool ID: " + envFeature . AppPoolId + Environment . NewLine ) ;
96+ await ctx . Response . WriteAsync ( "AppPool Config File: " + envFeature . AppPoolConfigFile + Environment . NewLine ) ;
97+ await ctx . Response . WriteAsync ( "Site ID: " + envFeature . SiteId + Environment . NewLine ) ;
98+ await ctx . Response . WriteAsync ( "Site Name: " + envFeature . SiteName ) ;
99+ }
100+ #endif
101+
70102 private async Task ASPNETCORE_IIS_PHYSICAL_PATH ( HttpContext ctx ) => await ctx . Response . WriteAsync ( Environment . GetEnvironmentVariable ( "ASPNETCORE_IIS_PHYSICAL_PATH" ) ) ;
71103
72104 private async Task ServerAddresses ( HttpContext ctx )
@@ -1128,7 +1160,7 @@ private async Task TransferEncodingHeadersWithMultipleValues(HttpContext ctx)
11281160 try
11291161 {
11301162#if ! FORWARDCOMPAT
1131- Assert . True ( ctx . Request . CanHaveBody ( ) ) ;
1163+ Assert . True ( ctx . Request . CanHaveBody ( ) ) ;
11321164#endif
11331165 Assert . True ( ctx . Request . Headers . ContainsKey ( "Transfer-Encoding" ) ) ;
11341166 Assert . Equal ( "gzip, chunked" , ctx . Request . Headers [ "Transfer-Encoding" ] ) ;
@@ -1146,7 +1178,7 @@ private async Task TransferEncodingAndContentLengthShouldBeRemove(HttpContext ct
11461178 try
11471179 {
11481180#if ! FORWARDCOMPAT
1149- Assert . True ( ctx . Request . CanHaveBody ( ) ) ;
1181+ Assert . True ( ctx . Request . CanHaveBody ( ) ) ;
11501182#endif
11511183 Assert . True ( ctx . Request . Headers . ContainsKey ( "Transfer-Encoding" ) ) ;
11521184 Assert . Equal ( "gzip, chunked" , ctx . Request . Headers [ "Transfer-Encoding" ] ) ;
0 commit comments