Skip to content
This repository was archived by the owner on Jun 3, 2020. It is now read-only.

Commit dac62bf

Browse files
committed
Fix exception when no Accept header is set
1 parent e0c0fa0 commit dac62bf

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/mime.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ exports.isFileContentBinary = async function (fsInstance, filepath) {
6666
// for a given HTTP accept header, provide a list of file-extensions to try
6767
exports.acceptHeaderExtensions = function (accept) {
6868
var exts = []
69-
accept = accept.split(',')
69+
accept = (accept || '').split(',')
7070
if (accept.includes('text/html') || (accept.length === 1 && accept[0] === '*/*')) exts.push('.html')
7171
if (accept.includes('text/css')) exts.push('.css')
7272
if (accept.includes('image/*') || accept.includes('image/apng')) exts = exts.concat(['.png', '.jpg', '.jpeg', '.gif'])

0 commit comments

Comments
 (0)