Skip to content

Commit

Permalink
feat: use utf8 charset for bundle response (#695)
Browse files Browse the repository at this point in the history
Summary:
**Summary**

The content-type value of bundle server's response header should be 'application/javascript; charset=UTF-8', so that the browser can display characters normally when accessing bundle file.

**Test plan**

0. All unit tests pass.
1. Utf8 characters are displayed normally in the browsers.

Pull Request resolved: #695

Reviewed By: motiz88

Differential Revision: D30392590

Pulled By: feedthejim

fbshipit-source-id: 1caa7b5a0f78c8363db31daea98745d4f8083c3d
  • Loading branch information
zhiqingchen authored and facebook-github-bot committed Sep 7, 2021
1 parent 793b1a0 commit 7d57801
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/metro/src/Server.js
Expand Up @@ -790,7 +790,7 @@ class Server {
String(result.numModifiedFiles),
);
mres.setHeader(DELTA_ID_HEADER, String(result.nextRevId));
mres.setHeader('Content-Type', 'application/javascript');
mres.setHeader('Content-Type', 'application/javascript; charset=UTF-8');
mres.setHeader('Last-Modified', result.lastModifiedDate.toUTCString());
mres.setHeader(
'Content-Length',
Expand Down

0 comments on commit 7d57801

Please sign in to comment.