Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
adamschwartz committed Jun 5, 2020
1 parent 4a2b453 commit 7b22ab9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions workers-site/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,9 @@ async function handleEvent(event) {

// // Manually adding utf8 charset for now since kv-asset-handler
// has it fixed (https://git.io/Jf1aQ) but it's not yet in a release
if (response.headers.get('content-type').startsWith('text')) {
response.headers.set('content-type', response.headers.get('content-type') + '; charset=utf8')
const contentType = response.headers.get('content-type')
if (contentType.startsWith('text')) {
response.headers.set('content-type', contentType + '; charset=utf8')
}

if (url.pathname === '/' || url.pathname === '/index.html') {
Expand Down

0 comments on commit 7b22ab9

Please sign in to comment.