Browse Source

@uppy/companion: add connection keep-alive to dropbox (#4365)

* add connection: keep-alive to dropbox

fixes #4357

* update a todo

* dont clear screen by vite

i want to also see companion's output
Mikael Finstad 2 years ago
parent
commit
ef1a945f79

+ 1 - 0
packages/@uppy/companion/src/server/provider/dropbox/index.js

@@ -73,6 +73,7 @@ class DropBox extends Provider {
         prefixUrl: 'https://content.dropboxapi.com/2',
         headers: {
           'Dropbox-API-Arg': httpHeaderSafeJson({ path: String(id) }),
+          Connection: 'keep-alive', // important because https://github.com/transloadit/uppy/issues/4357
         },
         body: Buffer.alloc(0), // if not, it will hang waiting for the writable stream
         responseType: 'json',

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

@@ -116,7 +116,7 @@ module.exports = function server (inputCompanionOptions) {
   if (companionOptions.redisUrl) {
     const RedisStore = connectRedis(session)
     const redisClient = redis.client(companionOptions)
-    // todo next major: change default prefix to something like "companion:" and possibly remove this option
+    // todo next major: change default prefix to something like "companion-session:" and possibly remove this option
     sessionOptions.store = new RedisStore({ client: redisClient, prefix: process.env.COMPANION_REDIS_EXPRESS_SESSION_PREFIX || 'sess:' })
   }
 

+ 1 - 1
private/dev/package.json

@@ -18,7 +18,7 @@
   "private": true,
   "type": "module",
   "scripts": {
-    "dev": "vite",
+    "dev": "vite --clearScreen false",
     "build": "vite build",
     "preview": "vite preview"
   }