X-Content-Type-Options: nosniff header prevents WebViews from loading assets
See original GitHub issueDo you want to request a feature or report a bug?
Report a bug.
What is the current behavior?
Metro sets the X-Content-Type-Options: nosniff
header which causes WebViews to refuse to execute assets loaded from the packager.
If the current behavior is a bug, please provide the steps to reproduce and a minimal repository on GitHub that we can yarn install
and yarn test
.
Repository can be found here.
Run the app and inspect the WebView content using Safari developer options:
What is the expected behavior?
Assets loaded from the packager shouldn’t always set the nosniff
header. There may have been reasons for adding this but I believe it should be made configurable for loading assets in development mode. Alternatively we should have a means to set Content-Type
for assets.
Please provide your exact Metro configuration and mention your Metro, node, yarn/npm version and operating system.
No extra metro configuration.
RN 58.6 yarn 1.13.0 node 11.10.0 macOS 10.14.3
Upgrading from RN 57.4 to 58.6 introduced this issue.
Headers running 57.4:
Headers running 58.6:
Issue Analytics
- State:
- Created 5 years ago
- Reactions:6
- Comments:7
Top GitHub Comments
Any update here?
Hi I am having the same issue of nosniff, please provide solution.