File tree 2 files changed +11
-5
lines changed
2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -48,16 +48,17 @@ public async Task Invoke(HttpContext httpContext)
48
48
await httpContext . Response . WriteAsync ( $ "<li>Configuration: { _configurationName } </li>") ;
49
49
await httpContext . Response . WriteAsync ( $ "<li>Server: { _hostingEnv . Configuration [ "server" ] } </li>") ;
50
50
await httpContext . Response . WriteAsync ( $ "<li>Server URLs: { _hostingEnv . Configuration [ "server.urls" ] } </li>") ;
51
+ await httpContext . Response . WriteAsync ( $ "<li>Supports Send File: { httpContext . Response . SupportsSendFile ( ) } </li>") ;
51
52
52
- await httpContext . Response . WriteAsync ( $ "<li>Server features:<ol>") ;
53
+ await httpContext . Response . WriteAsync ( $ "<li>Server features:<ul>") ;
54
+
53
55
foreach ( var feature in httpContext . Features )
54
56
{
55
57
await httpContext . Response . WriteAsync ( $ "<li>{ feature . Key . Name } </li>") ;
56
58
}
57
- await httpContext . Response . WriteAsync ( $ "</ol ></li>") ;
59
+ await httpContext . Response . WriteAsync ( $ "</ul ></li>") ;
58
60
59
61
await httpContext . Response . WriteAsync ( "</ul>" ) ;
60
-
61
62
return ;
62
63
}
63
64
Original file line number Diff line number Diff line change @@ -25,8 +25,13 @@ public async Task Invoke(HttpContext httpContext)
25
25
}
26
26
catch ( Exception ex )
27
27
{
28
- httpContext . Response . StatusCode = StatusCodes . Status500InternalServerError ;
29
- httpContext . Response . ContentType = "text/html" ;
28
+ if ( ! httpContext . Response . HasStarted )
29
+ {
30
+ httpContext . Response . Clear ( ) ;
31
+ httpContext . Response . StatusCode = StatusCodes . Status500InternalServerError ;
32
+ httpContext . Response . ContentType = "text/html" ;
33
+ }
34
+
30
35
await httpContext . Response . WriteAsync ( $ "<pre style='color:red'>{ ex . ToString ( ) } </pre>") ;
31
36
}
32
37
}
You can’t perform that action at this time.
0 commit comments