-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
Labels
area-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
When accepting a HTTP request with multiple headers of the same type, the collection returns a single element with values separated by a comma.
For example:
GET http://localhost:8888/weatherforecast/
Accept: application/json
Accept: application/xml
app.MapGet("/weatherforecast", (HttpContext ctx) =>
{
var accepts = ctx.Request.Headers["Accept"];
return accepts;
})
The result is that the variable accepts returns a single element with both headers concatenated:
Recording.2025-07-15.211805.mp4
Expected Behavior
If the HeaderValue returns a collection, it should return a collection of strings, not one string.
Steps To Reproduce
This is a repro case
Exceptions (if any)
No response
.NET Version
10.0.100-preview.5.25277.114
Anything else?
No response
Metadata
Metadata
Assignees
Labels
area-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions