Update check for 413 in IIS (#14589)

This commit is contained in:
Justin Kotalik 2019-10-02 08:06:39 +09:00 committed by Andrew Stanton-Nurse
parent db4087769e
commit 029a4c0a68
1 changed files with 5 additions and 3 deletions

View File

@ -49,8 +49,9 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests.InProcess
var result = await deploymentResult.HttpClient.PostAsync("/ReadRequestBody", new StringContent("test")); var result = await deploymentResult.HttpClient.PostAsync("/ReadRequestBody", new StringContent("test"));
// IIS returns a 404 instead of a 413... // IIS either returns a 404 or a 413 based on versions of IIS.
Assert.Equal(HttpStatusCode.NotFound, result.StatusCode); // Check for both as we don't know which specific patch version.
Assert.True(result.StatusCode == HttpStatusCode.NotFound || result.StatusCode == HttpStatusCode.RequestEntityTooLarge);
} }
[ConditionalFact] [ConditionalFact]
@ -68,7 +69,8 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests.InProcess
"Host: localhost", "Host: localhost",
"", "",
"A"); "A");
await connection.Receive("HTTP/1.1 404 Not Found"); var requestLine = await connection.ReadLineAsync();
Assert.True(requestLine.Contains("404") || requestLine.Contains("413"));
} }
} }