diff --git a/packages/sirv/index.mjs b/packages/sirv/index.mjs index 3ad14d4..22eae25 100644 --- a/packages/sirv/index.mjs +++ b/packages/sirv/index.mjs @@ -101,7 +101,13 @@ function toHeaders(name, stats, isEtag) { let enc = ENCODING[name.slice(-3)]; let ctype = lookup(name.slice(0, enc && -3)) || ''; - if (ctype === 'text/html') ctype += ';charset=utf-8'; + if ( + ctype === 'application/json' || + ctype === 'application/manifest+json' || + ctype.startsWith('text/') + ) { + ctype += ';charset=utf-8'; + } let headers = { 'Content-Length': stats.size,