소스 검색

companion: exit function after sending response (#2687)

fixes #2684
Ifedapo .A. Olarewaju 4 년 전
부모
커밋
415231eef4
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  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) => {
   provider.thumbnail({ id, token }, (err, response) => {
     if (err) {
     if (err) {
       err.isAuthError ? res.sendStatus(401) : next(err)
       err.isAuthError ? res.sendStatus(401) : next(err)
+      return
     }
     }
     response ? response.pipe(res) : res.sendStatus(404)
     response ? response.pipe(res) : res.sendStatus(404)
   })
   })