Open hajekj opened 1 year ago
I noticed that this is also happening when hosting .resx on App Service, because .resx
is explicitly disallowed in applicationHost.config
. In App Service, I managed to mitigate this issue by adding the following into my applicationHost.xdt
file.
<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<system.webServer>
<security>
<requestFiltering>
<fileExtensions>
<add fileExtension=".resx" allowed="true" xdt:Transform="Replace" xdt:Locator="Match(fileExtension)" />
</fileExtensions>
</requestFiltering>
</security>
</system.webServer>
</configuration>
However, this doesn't work for Static Web Apps.
@mkarmark this is blocking @hajekj & his implementation, any chance we can investigate enabling these file extensions?
I'm having the same problem with .cs
files. Any updates on this?
Hi @kargo, looking to learn more about the use case for hosting .cs files, what are they being used for? Would help understand the need for caching/etc.
@thomasgauvin, the company I work for is using Azure Static Web Apps to host our developer documentation site. We're using snippets from .cs
files for code blocks in examples, but we would also like to link to the full file.
We're using MkDocs to generate the documentation site.
I've tried setting the mime-type for the .cs
files to text/plain in our staticwebapp.config.json to no avail. If I add a rewrite rule for each file I can get Azure to serve the file by omitting the file type. However that isn't scalable as we have many files and adding a rewrite rule for each route is cumbersome.
{
"routes": [
{
"route": "/assets/example/Program",
"rewrite": "/assets/example/Program.cs"
}
],
"mimeTypes": {
".cs": "text/plain"
}
}
@thomasgauvin - any update on this please?
Describe the bug
When publishing a static application which contains
.resx
files, attempting to download them will result in a 404 error.To Reproduce Steps to reproduce the behavior:
Expected behavior A clear and concise description of what you expected to happen.
The file should download.
Screenshots N/A
Device info (if applicable): N/A
Additional context
I also tried explicitly specifying MIME type for it, but no change. This is currently blocking us from migrating to Static Web Apps. In Storage Static Web it works fine.
I also noticed some really weird behavior:
I have
navigationFallback
set toindex.html
but whenever I try to visit something like: https://zealous-field-0ddb22503-preview.westeurope.1.azurestaticapps.net/thisfilereallydoesntexist.resx, I still get 404 instead of myindex.html
.