File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change 1
1
import 'cross-fetch/polyfill' ; /* global fetch */
2
2
import qs from 'qs' ;
3
3
import jsYaml from 'js-yaml' ;
4
- import { Buffer } from 'buffer' ;
5
4
import { FormData , File , Blob } from 'formdata-node' ;
6
5
7
6
import { encodeDisallowedCharacters } from '../execute/oas3/style-serializer' ;
@@ -167,7 +166,7 @@ export function isFile(obj, navigatorObj) {
167
166
if ( typeof Blob !== 'undefined' && obj instanceof Blob ) {
168
167
return true ;
169
168
}
170
- if ( Buffer . isBuffer ( obj ) ) {
169
+ if ( ArrayBuffer . isView ( obj ) ) {
171
170
return true ;
172
171
}
173
172
@@ -350,14 +349,14 @@ function buildFormData(reqForm) {
350
349
if ( Array . isArray ( value ) ) {
351
350
// eslint-disable-next-line no-restricted-syntax
352
351
for ( const v of value ) {
353
- if ( Buffer . isBuffer ( v ) ) {
352
+ if ( ArrayBuffer . isView ( v ) ) {
354
353
const blob = new Blob ( [ v ] ) ;
355
354
formData . append ( key , blob ) ;
356
355
} else {
357
356
formData . append ( key , v ) ;
358
357
}
359
358
}
360
- } else if ( Buffer . isBuffer ( value ) ) {
359
+ } else if ( ArrayBuffer . isView ( value ) ) {
361
360
const blob = new Blob ( [ value ] ) ;
362
361
formData . append ( key , blob ) ;
363
362
} else {
You can’t perform that action at this time.
0 commit comments