@@ -21,25 +21,46 @@ internal static class Utilities
2121 private static int NextPort = BasePort ;
2222 private static object PortLock = new object ( ) ;
2323
24- internal static IServer CreateHttpServer ( out string baseAddress , RequestDelegate app )
24+ internal static IServer CreateHttpServer ( out string baseAddress , RequestDelegate app , bool enableKernelBuffering = false )
2525 {
2626 string root ;
27- return CreateDynamicHttpServer ( string . Empty , AuthenticationSchemes . None , true , out root , out baseAddress , app ) ;
27+ return CreateDynamicHttpServer (
28+ basePath : string . Empty ,
29+ authType : AuthenticationSchemes . None ,
30+ allowAnonymous : true ,
31+ enableKernelBuffering : enableKernelBuffering ,
32+ root : out root ,
33+ baseAddress : out baseAddress ,
34+ app : app ) ;
2835 }
2936
3037 internal static IServer CreateHttpServerReturnRoot ( string path , out string root , RequestDelegate app )
3138 {
3239 string baseAddress ;
33- return CreateDynamicHttpServer ( path , AuthenticationSchemes . None , true , out root , out baseAddress , app ) ;
40+ return CreateDynamicHttpServer (
41+ basePath : path ,
42+ authType : AuthenticationSchemes . None ,
43+ allowAnonymous : true ,
44+ enableKernelBuffering : false ,
45+ root : out root ,
46+ baseAddress : out baseAddress ,
47+ app : app ) ;
3448 }
3549
3650 internal static IServer CreateHttpAuthServer ( AuthenticationSchemes authType , bool allowAnonymous , out string baseAddress , RequestDelegate app )
3751 {
3852 string root ;
39- return CreateDynamicHttpServer ( string . Empty , authType , allowAnonymous , out root , out baseAddress , app ) ;
53+ return CreateDynamicHttpServer (
54+ basePath : string . Empty ,
55+ authType : authType ,
56+ allowAnonymous : allowAnonymous ,
57+ enableKernelBuffering : false ,
58+ root : out root ,
59+ baseAddress : out baseAddress ,
60+ app : app ) ;
4061 }
4162
42- internal static IServer CreateDynamicHttpServer ( string basePath , AuthenticationSchemes authType , bool allowAnonymous , out string root , out string baseAddress , RequestDelegate app )
63+ internal static IServer CreateDynamicHttpServer ( string basePath , AuthenticationSchemes authType , bool allowAnonymous , bool enableKernelBuffering , out string root , out string baseAddress , RequestDelegate app )
4364 {
4465 lock ( PortLock )
4566 {
@@ -55,6 +76,7 @@ internal static IServer CreateDynamicHttpServer(string basePath, AuthenticationS
5576 server . Features . Get < IServerAddressesFeature > ( ) . Addresses . Add ( baseAddress ) ;
5677 server . Listener . Settings . Authentication . Schemes = authType ;
5778 server . Listener . Settings . Authentication . AllowAnonymous = allowAnonymous ;
79+ server . Listener . Settings . EnableKernelResponseBuffering = enableKernelBuffering ;
5880 try
5981 {
6082 server . Start ( new DummyApplication ( app ) ) ;
0 commit comments