[release/2.1] Add support and tests for HTTP 308 Permanent Redirect (#30398)#30954
[release/2.1] Add support and tests for HTTP 308 Permanent Redirect (#30398)#30954rmkerr merged 1 commit intodotnet:release/2.1from
Conversation
This change adds support for 308 redirects to SocketsHttpHandler, and enables 308 redirects in our tests. Fixes: #30389
|
@dotnet-bot test Outerloop Windows x64 Debug Build |
|
The OSX failures are unrelated. The other two are a bit more suspicious as they are in System.Net.Http, even though none of the failed tests are using redirects. I'm going to do a rerun of those to see if we see the same results. @dotnet-bot test Outerloop Windows x64 Debug Build |
|
Approved to merge pending tests/review signoff. |
|
There are three failures happening in the System.Net.Http tests. One is clearly unrelated, but unless I can find some evidence that the other two were already occurring I think we should hold off on merging this for 2.1.3. Details of the failures are below: GetAsyncWithMaxConnections_DisposeBeforeReadingToEnd_DrainsRequestsAndReusesConnection: AuthProxy__ValidCreds_ProxySendsRequestToServer: Brotli_External_DecompressesResponse_Success: |
Is this test failing on .NET Core or .NET Framework? This test is not reliable on .NET Framework and really only should be testing with .NET Core using SocketsHttpHandler. The test shouldn't run on any other handler as the "drain" behavior doesn't match SocketsHttpHandler. |
|
That failure is on .NET Framework. Thanks for the info -- I'll dig into the other failure and see if it is something similar. |
|
A baseline run of the 2.1 servicing branch with no changes did not show the same failure. Giving it one more try... @dotnet-bot test Outerloop Windows x64 Debug Build |
|
The tests aren't finished, but the test in question passed. I would prefer to have CI green, but there appear to be test failures on the 2.1 release branch without these changes. I'm confident that these changes are not related to the failures we saw, and am going to merge them. |
The HttpStatusCode enum was only recently updated to include HTTP status code 308, via PR #26727. With the platform handlers we support whatever cURL and WinHttp support, so 308 works even though the status code did not exist in the enum until recently. However in SocketsHttpHandler we only support the redirects that were in the enum when that code was written, which at the time did not include 308.
This PR adds support for 308 redirects to SocketsHttpHandler, and enables 308 redirects in our tests.
This is an exact port of PR #30398.
Fixes: #30389