Skip to content

Commit eaecffb

Browse files
committed
Enable IIS connection: close test.
1 parent a5daae3 commit eaecffb

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

test/ServerComparison.FunctionalTests/ResponseTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ public Task ResponseFormats_Kestrel_ContentLength(ServerType serverType, Runtime
3434
return ResponseFormats(serverType, runtimeFlavor, architecture, applicationBaseUrl, CheckContentLengthAsync);
3535
}
3636

37-
// [ConditionalTheory]
38-
// [OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)]
39-
// TODO: Not supported [InlineData(ServerType.IISExpress, RuntimeFlavor.CoreClr, RuntimeArchitecture.x86, "http://localhost:5071/")]
37+
[ConditionalTheory]
38+
[OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)]
39+
[InlineData(ServerType.IISExpress, RuntimeFlavor.CoreClr, RuntimeArchitecture.x86, "http://localhost:5071/")]
4040
// https://github.com/aspnet/Helios/issues/148
4141
// TODO: Chunks anyways [InlineData(ServerType.WebListener, RuntimeFlavor.Clr, RuntimeArchitecture.x86, "http://localhost:5073/")]
4242
// https://github.com/aspnet/WebListener/issues/113
@@ -155,8 +155,8 @@ private static async Task CheckConnectionCloseAsync(HttpClient client, ILogger l
155155
var response = await client.GetAsync("connectionclose");
156156
responseText = await response.Content.ReadAsStringAsync();
157157
Assert.Equal("Connnection Close", responseText);
158-
Assert.Null(response.Headers.TransferEncodingChunked);
159158
Assert.True(response.Headers.ConnectionClose, "/connectionclose, closed?");
159+
Assert.Null(response.Headers.TransferEncodingChunked);
160160
Assert.Null(GetContentLength(response));
161161
}
162162
catch (XunitException)

test/ServerComparison.TestSites/StartupResponses.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@ public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory)
2525

2626
app.Map("/connectionclose", subApp =>
2727
{
28-
subApp.Run(context =>
28+
subApp.Run(async context =>
2929
{
3030
context.Response.Headers[HeaderNames.Connection] = "close";
31-
return context.Response.WriteAsync("Connnection Close");
31+
await context.Response.WriteAsync("Connnection Close");
32+
await context.Response.Body.FlushAsync(); // Bypass IIS write-behind buffering
3233
});
3334
});
3435

0 commit comments

Comments
 (0)