Skip to content

Commit

Permalink
fix: 404 is noice
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Varache committed Sep 26, 2019
1 parent a41c09c commit df87c01
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/spa-stream-protocol-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ function getExtension(p) {
}

function getResponse(req, filePath) {
const fileStat = fs.statSync(filePath);
let fileStat;
try {
fileStat = fs.statSync(filePath);
} catch (e) {
return { status: 404, headers: {}, stream: fs.createReadStream(filePath) };
}
const headers = {};
// Handle video/audio streaming (or seeking)
if (req.headers.Range) {
Expand Down

0 comments on commit df87c01

Please sign in to comment.