Skip to content

MapStaticAssets breaks endpoint routing in container #59964

@bradmarder

Description

@bradmarder

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Including MapStaticAssets() in my dev environment within a Docker container will cause POST requests to return 405 HTTP Method Not Supported. Removing that one line of code fixes the issue. I have zero assets for dev, but a few for prod, and a different docker setup, but it all works perfectly there.

Expected Behavior

MapStaticAssets() should not break endpoint routing (unless there is some naming conflict of files/paths)

Steps To Reproduce

Sorry I have no time for a simple repro, so this is all I have. https://github.com/bradmarder/LootGod

I normally just run docker compose watch to start it all up, and it seems any POST request will fail.

Exceptions (if any)

405 HTTP Method Not Supported

.NET Version

9.0.102

Anything else?

It took me quite a bit of time to figure out MapStaticAssets() was causing the issue, especially since the error and symptoms and diagnosing process were all so weird. Also I'm using a WebApplicationFactory and HttpClient to run tests on every endpoint, and they all pass.

Metadata

Metadata

Assignees

Labels

Needs: Author FeedbackThe author of this issue needs to respond in order for us to continue investigating this issue.Needs: ReproIndicates that the team needs a repro project to continue the investigation on this issueStatus: No Recent Activityarea-ui-renderingIncludes: MVC Views/Pages, Razor Views/Pagesfeature-static-web-assets

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions