Add missing content type header for assets to metro server. #953
+33
−1
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.
Summary
I'm a maintainer of
expo-image
on the web platform.To support rendering svg assets by passing the URI to the
<img>
src prop, it's necessary for the asset url to return the correct content type.The solution follows the code described in this issue, and was tested to work and allow using SVG assets on web in an expected way.
Fixes #394.
Test plan
SVG returned as text without the patch in this PR:

SVG rendered correctly on asset URL after applying the patch:

Expected content type:
