propro-utils 1.5.7 → 1.5.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/server/index.js +8 -5
package/package.json
CHANGED
package/src/server/index.js
CHANGED
|
@@ -330,17 +330,20 @@ class AuthMiddleware {
|
|
|
330
330
|
}
|
|
331
331
|
}
|
|
332
332
|
|
|
333
|
-
|
|
333
|
+
let headers = {};
|
|
334
|
+
let formData = null;
|
|
335
|
+
|
|
334
336
|
if (req.file) {
|
|
337
|
+
formData = new FormData();
|
|
335
338
|
formData.append('file', req.file.buffer, {
|
|
336
339
|
filename: req.file.originalname,
|
|
337
340
|
contentType: req.file.mimetype,
|
|
338
341
|
});
|
|
339
|
-
}
|
|
340
342
|
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
343
|
+
headers = {
|
|
344
|
+
...formData.getHeaders(),
|
|
345
|
+
};
|
|
346
|
+
}
|
|
344
347
|
|
|
345
348
|
if (accessToken) {
|
|
346
349
|
headers.Authorization = `Bearer ${accessToken}`;
|