[cli] add charset to content-type headers for vc dev (#9364)

Adds `charset: utf8` to the `content-type` header
This commit is contained in:
Ethan Arrowood
2023-02-01 18:07:08 -07:00
committed by GitHub
parent a4d16c681a
commit 804a3863e7
3 changed files with 5 additions and 4 deletions

View File

@@ -1129,10 +1129,10 @@ export default class DevServer {
});
body = `${json}\n`;
} else if (accept.includes('html')) {
res.setHeader('content-type', 'text/html');
res.setHeader('content-type', 'text/html; charset=utf-8');
body = redirectTemplate({ location, statusCode });
} else {
res.setHeader('content-type', 'text/plain');
res.setHeader('content-type', 'text/plain; charset=utf-8');
body = `Redirecting to ${location} (${statusCode})\n`;
}
res.end(body);