Skip to content

Commit

Permalink
fix typing check
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Stramel committed Jun 19, 2020
1 parent 5b6c83b commit f59f7b1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/commands/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,9 @@ const sendFile = (
ext = '.html',
) => {
const ETag = etag(body, {weak: true});
const contentType = mime.contentType(ext)
const headers: Record<string, string> = {
'Content-Type': mime.contentType(ext) || 'application/octet-stream',
'Content-Type': contentType || 'application/octet-stream',
'Access-Control-Allow-Origin': '*',
ETag,
Vary: 'Accept-Encoding',
Expand All @@ -127,7 +128,8 @@ const sendFile = (
if (
req.headers['cache-control']?.includes('no-transform') ||
['HEAD', 'OPTIONS'].includes(req.method!) ||
!isCompressible(mime.contentType(ext) as string)
!contentType ||
!isCompressible(contentType)
) {
acceptEncoding = '';
}
Expand Down

0 comments on commit f59f7b1

Please sign in to comment.