Closed
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
I'm trying to upgrade a .NET 6 web application to .NET 8 RC1. I have app.UseHttpMethodOverride()
to allow client to post with the X-Http-Method-Override
header.
I'm getting 405 (Method Not Allowed) responses from the endpoints that are mapping non-POST methods. My code is not getting called at all. It's like the pipeline is failing to use the modified HTTP method to route correctly.
Expected Behavior
My endpoint for a non-POST HTTP method should be called.
Steps To Reproduce
Minimal reproduction:
var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();
app.UseHttpMethodOverride();
app.MapDelete("/", () => "delete");
app.Run();
Run that, then make a request e.g. with powershell:
Invoke-WebRequest -Uri http://localhost:5070/ -Method POST -Headers @{ 'X-Http-Method-Override' = 'DELETE' }
Exceptions (if any)
No response
.NET Version
8.0.100-rc.1.23463.5
Anything else?
No response