Skip to content

Update check for 413 in IIS #14589

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 1, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ public async Task SetIISLimitMaxRequestBodySizeE2EWorks()

var result = await deploymentResult.HttpClient.PostAsync("/ReadRequestBody", new StringContent("test"));

// IIS returns a 404 instead of a 413...
Assert.Equal(HttpStatusCode.NotFound, result.StatusCode);
// IIS either returns a 404 or a 413 based on versions of IIS.
// Check for both as we don't know which specific patch version.
Assert.True(result.StatusCode == HttpStatusCode.NotFound || result.StatusCode == HttpStatusCode.RequestEntityTooLarge);
}

[ConditionalFact]
Expand All @@ -68,7 +69,8 @@ await connection.Send(
"Host: localhost",
"",
"A");
await connection.Receive("HTTP/1.1 404 Not Found");
var requestLine = await connection.ReadLineAsync();
Assert.True(requestLine.Contains("404") || requestLine.Contains("413"));
}
}

Expand Down