@uploadcare/upload-client 6.0.1-alpha.4 → 6.0.1-alpha.5
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/dist/index.browser.js
CHANGED
|
@@ -465,7 +465,8 @@ function base(file, { publicKey, fileName, contentType, baseURL = defaultSetting
|
|
|
465
465
|
jsonerrors: 1
|
|
466
466
|
}),
|
|
467
467
|
headers: {
|
|
468
|
-
'X-UC-User-Agent': getUserAgent({ publicKey, integration, userAgent })
|
|
468
|
+
'X-UC-User-Agent': getUserAgent({ publicKey, integration, userAgent }),
|
|
469
|
+
'content-type': 'multipart/form-data'
|
|
469
470
|
},
|
|
470
471
|
data: buildFormData({
|
|
471
472
|
file: {
|
package/dist/index.node.js
CHANGED
|
@@ -489,7 +489,8 @@ function base(file, { publicKey, fileName, contentType, baseURL = defaultSetting
|
|
|
489
489
|
jsonerrors: 1
|
|
490
490
|
}),
|
|
491
491
|
headers: {
|
|
492
|
-
'X-UC-User-Agent': getUserAgent({ publicKey, integration, userAgent })
|
|
492
|
+
'X-UC-User-Agent': getUserAgent({ publicKey, integration, userAgent }),
|
|
493
|
+
'content-type': 'multipart/form-data'
|
|
493
494
|
},
|
|
494
495
|
data: buildFormData({
|
|
495
496
|
file: {
|
|
@@ -260,7 +260,7 @@ const isReactNativeUri = (uri) => {
|
|
|
260
260
|
const getFileOptions = ({ name }) => name ? [name] : [];
|
|
261
261
|
const transformFile = (file, name, contentType) => {
|
|
262
262
|
if (typeof file === 'string' && isReactNativeUri(file)) {
|
|
263
|
-
return
|
|
263
|
+
return file;
|
|
264
264
|
}
|
|
265
265
|
// const uri = URL.createObjectURL(file as BrowserFile)
|
|
266
266
|
// const type = contentType || (file as BrowserFile).type
|
|
@@ -312,7 +312,7 @@ const isFileValue = (value) => !!value &&
|
|
|
312
312
|
function collectParams(params, inputKey, inputValue) {
|
|
313
313
|
if (isFileValue(inputValue)) {
|
|
314
314
|
const { name, contentType } = inputValue;
|
|
315
|
-
const file = transformFile(inputValue.data
|
|
315
|
+
const file = transformFile(inputValue.data); // lgtm [js/superfluous-trailing-arguments]
|
|
316
316
|
const options = getFileOptions({ name, contentType });
|
|
317
317
|
params.push([inputKey, file, ...options]);
|
|
318
318
|
}
|
|
@@ -468,7 +468,8 @@ function base(file, { publicKey, fileName, contentType, baseURL = defaultSetting
|
|
|
468
468
|
jsonerrors: 1
|
|
469
469
|
}),
|
|
470
470
|
headers: {
|
|
471
|
-
'X-UC-User-Agent': getUserAgent({ publicKey, integration, userAgent })
|
|
471
|
+
'X-UC-User-Agent': getUserAgent({ publicKey, integration, userAgent }),
|
|
472
|
+
'content-type': 'multipart/form-data'
|
|
472
473
|
},
|
|
473
474
|
data: buildFormData({
|
|
474
475
|
file: {
|