Browse Source

companion: exit function after sending response (#2687)

fixes #2684
Ifedapo .A. Olarewaju 4 years ago
parent
commit
415231eef4
1 changed files with 1 additions and 0 deletions
  1. 1 0
      packages/@uppy/companion/src/server/controllers/thumbnail.js

+ 1 - 0
packages/@uppy/companion/src/server/controllers/thumbnail.js

@@ -12,6 +12,7 @@ function thumbnail (req, res, next) {
   provider.thumbnail({ id, token }, (err, response) => {
     if (err) {
       err.isAuthError ? res.sendStatus(401) : next(err)
+      return
     }
     response ? response.pipe(res) : res.sendStatus(404)
   })