Closed danroth27 closed 1 year ago
@javiercn @stevesandersonms Why is a plain text response returned for this error instead of the normal ASP.NET Core developer exception page? Is that a separate issue?
The underlying issue here is probably https://github.com/dotnet/razor/issues/9323, i.e., a regression in Razor that was fixed for GA but as far as I know, RC2 will be shipping with that regression inside it. It breaks a lot of form scenarios. We discussed and heard there's no option to get the fix into RC2.
As for why there's a plaintext response, it's because this isn't an unhandled exception. It's a behavior in EndpointHtmlRenderer
that intentionally returns this 400 with this message hardcoded to be in plaintext. This is because developers should only see this in development, and never in production, because it should only happen if your app code is objectively wrong. We could change it to do an unhandled exception (so the exception middleware kicks in), but that would give the public a trivial way to trigger an unlimited number of unhandled exceptions in production if they just want to spam the logs.
The underlying issue here is probably https://github.com/dotnet/razor/issues/9323, i.e., a regression in Razor that was fixed for GA
OK, I'll add a known issue to the RC2 blog post for this, both a generic version that mention the error and a specific mention of the logout issue.
As for why there's a plaintext response, it's because this isn't an unhandled exception. It's a behavior in EndpointHtmlRenderer that intentionally returns this 400 with this message hardcoded to be in plaintext.
Got it, make sense.
Closing as this is fixed and will be in the 8.0 GA: https://github.com/dotnet/razor/issues/9323
@SteveSandersonMS Is there a workaround for the form, or do we need to wait until GA? The default Blazor template with Individual accounts gives the same exception when clicking on the Logout button.
It doesn't give an error when If put another @formname="abcd" next to it.
It doesn't give an error when If put another @formname="abcd" next to it.
This works indeed.
Repro steps:
Expected result: The user is logged out successfully Actual result: 400 Bad Request returned with plain error text: