Skip to content

Commit

Permalink
/file with do_minify=false, fix reply already sent errors (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
mreishus authored Jan 24, 2025
1 parent cd70450 commit 7019ab6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions routes/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,11 @@ module.exports = async ( request, reply ) => {
if ( ! do_minify ) {
try {
await send_reply( fs.readFileSync( path ).toString(), reply, accept, level );
return;
} catch ( err ) {
console.log( err );
send_error( reply, err, 404, 10404 );
return;
}
}

Expand Down Expand Up @@ -118,6 +120,7 @@ module.exports = async ( request, reply ) => {
}

reply.send( body );
return;
}

log.original_size = body.length;
Expand Down

0 comments on commit 7019ab6

Please sign in to comment.