[Static Web Assets] Allow assets with empty base paths #17414
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Static web assets don't work properly if the library specifies an empty base path "/".
Fixes #17375
Customer Impact
This prevents customers from exposing static web assets at the root of the app. The asset will still get published to the root, but will be inaccessible when running the build output.
Regression?
No
Risk
Low. This is not a default use case for static web assets (normally the content for libraries gets exposed from
_content/<<LibraryName>>/...
). But we want to be able to expose the content from "/" for Blazor applications and this is blocking it.We are not changing a behavior in how the scenario work, simply fixing a bug where something didn't work to something that works.
Implementation details
We simply detect this special case and handle it.