Skip to content

Duplicate Accept-Ranges Header when using MapStaticAssets #56436

@Spacefish

Description

@Spacefish

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

I created a new .NET 9 Preview 5 Web API Project and added the
app.MapStaticAssets() right after app.MapControllers();

when i put .png files into wwwroot publish the app and then access one of the .PNG files.
The server reponds with two "Accept-Ranges: bytes" headers instead of one:

image

Expected Behavior

The "Accept-Ranges" header should only be included once in the response

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version

9.0.100-preview.5.24307.3

Anything else?

One time it´s probably added here:

responseHeaders.Headers.AcceptRanges = "bytes";

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesfeature-static-web-assets

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions