You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you make a request using an Accept header that uses the json suffix, for example application/vnd.foo+json, this disables problem details, despite the requested output format being json.
Expected Behavior
Problem details should not be disabled
Steps To Reproduce
Create a minimal API project with the following code:
Run curl http://localhost:5182/hello -H "Accept: application/vnd.foo+json"
Observe curl prints Status Code: 405; Method Not Allowed instead of {"type":"https://tools.ietf.org/html/rfc9110#section-15.5.6","title":"Method Not Allowed","status":405}
Exceptions (if any)
N/A
.NET Version
9.0.100-preview.7.24407.12
Anything else?
ASP.NET Core version: 8.0 I think? My TFM is net8.0
IDE: VSCode 1.92.2
> dotnet --info
.NET SDK:
Version: 9.0.100-preview.7.24407.12
Commit: d672b8a045
Workload version: 9.0.100-manifests.baed1e37
MSBuild version: 17.12.0-preview-24374-02+48e81c6f1
Runtime Environment:
OS Name: Windows
OS Version: 10.0.26100
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\9.0.100-preview.7.24407.12\
.NET workloads installed:
Configured to use loose manifests when installing new manifests.
There are no installed workloads to display.
Host:
Version: 9.0.0-preview.7.24405.7
Architecture: x64
Commit: static
.NET SDKs installed:
9.0.100-preview.7.24407.12 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.32 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.0-preview.7.24406.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.18 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.32 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.33 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.0-preview.7.24405.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.18 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.32 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.33 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.7 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.0-preview.7.24405.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]
Environment variables:
Not set
global.json file:
Not found
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/download
Is there an existing issue for this?
Describe the bug
When you make a request using an
Accept
header that uses thejson
suffix, for exampleapplication/vnd.foo+json
, this disables problem details, despite the requested output format being json.Expected Behavior
Problem details should not be disabled
Steps To Reproduce
curl http://localhost:5182/hello -H "Accept: application/vnd.foo+json"
Status Code: 405; Method Not Allowed
instead of{"type":"https://tools.ietf.org/html/rfc9110#section-15.5.6","title":"Method Not Allowed","status":405}
Exceptions (if any)
N/A
.NET Version
9.0.100-preview.7.24407.12
Anything else?
ASP.NET Core version: 8.0 I think? My TFM is
net8.0
IDE: VSCode 1.92.2
For context, I am currently implementing https://github.com/swiftlang/swift-package-manager/blob/main/Documentation/PackageRegistry/Registry.md, which uses a custom
Accept
header for API versioning, but requires problem details responses for any error.The text was updated successfully, but these errors were encountered: