This is a cherry pick of the 3.1 PR.
https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore/pullrequest/9042
The only change was to remove a questionable call to Abort after catching the exception.
There are some less severe issues in Kestrel and MVC that we'll follow up on publicly after this releases.