Azure / Azure/static-web-apps

Cannot override Content-Type header for specific route

Open
#402 20 comments 4 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
346
Forks
67
PR merge metrics
No merged PRs in 30d

Description

Hi ,
I have several files in my webservice which are gzipped and should have content encoding header gzip, but at the same time they have different content types (js, wasm). If override their content type in route-headers section in staticwebapp.config.json
![image](https://user-images.githubusercontent.com/68467471/117326651-2b4f2f00-ae92-11eb-8ff1-7e5808357533.png)
it blindly ignores these changes and reset it to "application/gzip" in response header which leads to loading problems.
![image](https://user-images.githubusercontent.com/68467471/117326759-4457e000-ae92-11eb-9649-4f4541663005.png)
I also tried to specify mimeTypes sections but it ignores as well. There is only one solution which helped me to set header "x-content-type-options": "" . But it works not in all browsers.
It seems content type header somehow depends on encoding type, but it's very unclear how. Could you , please, explain how can I override content-types header for specific routes independently of encoding type.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.