File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -214,15 +214,11 @@ export class FormDataEncoder {
214
214
header += `Content-Type: ${ value . type || "application/octet-stream" } `
215
215
}
216
216
217
- const size = isFile ( value ) ? value . size : value . byteLength
218
- if (
219
- this . #options. enableAdditionalHeaders === true
220
- && size != null
221
- && ! isNaN ( size )
222
- ) {
223
- header += `${ this . #CRLF} Content-Length: ${
224
- isFile ( value ) ? value . size : value . byteLength
225
- } `
217
+ if ( this . #options. enableAdditionalHeaders === true ) {
218
+ const size = isFile ( value ) ? value . size : value . byteLength
219
+ if ( size != null && ! isNaN ( size ) ) {
220
+ header += `${ this . #CRLF} Content-Length: ${ size } `
221
+ }
226
222
}
227
223
228
224
return this . #encoder. encode ( `${ header } ${ this . #CRLF. repeat ( 2 ) } ` )
You can’t perform that action at this time.
0 commit comments