소스 검색

companion: fix wss breaking change

ifedapoolarewaju 5 년 전
부모
커밋
55fbe97eb7
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      packages/@uppy/companion/src/companion.js

+ 2 - 2
packages/@uppy/companion/src/companion.js

@@ -129,9 +129,9 @@ module.exports.socket = (server) => {
   // A new connection is usually created when an upload begins,
   // or when connection fails while an upload is on-going and,
   // client attempts to reconnect.
-  wss.on('connection', (ws) => {
+  wss.on('connection', (ws, req) => {
     // @ts-ignore
-    const fullPath = ws.upgradeReq.url
+    const fullPath = req.url
     // the token identifies which ongoing upload's progress, the socket
     // connection wishes to listen to.
     const token = fullPath.replace(/^.*\/api\//, '')