Skip to content

Commit

Permalink
fix(sirv-cli): pass headers for opts.single passthru (#23)
Browse files Browse the repository at this point in the history
* pass an empty headers object on no match

`send()` in `sirv` expects headers to be defined on the request.

* spacing
  • Loading branch information
bryanwood authored and lukeed committed Apr 23, 2019
1 parent f0ea2e2 commit 1f515fe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/sirv-cli/boot.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module.exports = function (dir, opts) {
}

if (opts.single) {
opts.onNoMatch = res => fn({ path:'/' }, res, r => (r.statusCode=404,r.end()));
opts.onNoMatch = res => fn({ path:'/', headers:{} }, res, r => (r.statusCode=404,r.end()));
}

fn = sirv(dir, opts);
Expand Down

0 comments on commit 1f515fe

Please sign in to comment.