We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1588c90 commit 06b4252Copy full SHA for 06b4252
src/FormData.ts
@@ -2,7 +2,7 @@ import path from 'node:path';
2
import _FormData from 'form-data';
3
4
// eslint-disable-next-line
5
-const ASCII_RE = /[^\x00-\x7F]/i;
+const NON_ASCII_RE = /[^\x00-\x7F]/i;
6
7
export class FormData extends _FormData {
8
_getContentDisposition(value: any, options: any) {
@@ -28,7 +28,7 @@ export class FormData extends _FormData {
28
// https://datatracker.ietf.org/doc/html/rfc6266#section-4.1
29
// support non-ascii filename
30
contentDisposition = 'filename="' + filename + '"';
31
- if (ASCII_RE.test(filename)) {
+ if (NON_ASCII_RE.test(filename)) {
32
contentDisposition += '; filename*=UTF-8\'\'' + encodeURIComponent(filename);
33
}
34
0 commit comments