Skip to content

Commit

Permalink
Handle stream errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Apr 22, 2018
1 parent dbdbe4a commit 56cf241
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/send.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const sendAvatar = ({ url, res, isError }) => {
stream.on('response', resAvatar =>
res.set('Content-Type', resAvatar.headers['content-type'])
)
stream.on('error', () => res.status(404))
return stream.pipe(res)
}

Expand Down

0 comments on commit 56cf241

Please sign in to comment.