浏览代码

Merge pull request #1142 from tranvansang/patch-3

Fix: socket does not handle server.path option
Ifedapo .A. Olarewaju 6 年之前
父节点
当前提交
79156463ce
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      packages/@uppy/companion/src/uppy.js

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

@@ -117,7 +117,7 @@ module.exports.socket = (server) => {
     const fullPath = ws.upgradeReq.url
     // the token identifies which ongoing upload's progress, the socket
     // connection wishes to listen to.
-    const token = fullPath.replace(/\/api\//, '')
+    const token = fullPath.replace(/^.*\/api\//, '')
     logger.info(`connection received from ${token}`, 'socket.connect')
 
     /**