62 lines
3.3 KiB
Diff
62 lines
3.3 KiB
Diff
|
diff --git a/node_modules/formdata-polyfill/FormData.js b/node_modules/formdata-polyfill/FormData.js
|
||
|
index 8e73660..7b64ba4 100644
|
||
|
--- a/node_modules/formdata-polyfill/FormData.js
|
||
|
+++ b/node_modules/formdata-polyfill/FormData.js
|
||
|
@@ -71,7 +71,7 @@ if (typeof Blob !== 'undefined' && (typeof FormData === 'undefined' || !FormData
|
||
|
|
||
|
function ensureArgs (args, expected) {
|
||
|
if (args.length < expected) {
|
||
|
- throw new TypeError(`${expected} argument required, but only ${args.length} present.`)
|
||
|
+ throw new TypeError(expected + " argument required, but only " + args.length.toString() + " present.")
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@@ -342,11 +342,11 @@ if (typeof Blob !== 'undefined' && (typeof FormData === 'undefined' || !FormData
|
||
|
['_blob'] () {
|
||
|
const boundary = '----formdata-polyfill-' + Math.random(),
|
||
|
chunks = [],
|
||
|
- p = `--${boundary}\r\nContent-Disposition: form-data; name="`
|
||
|
+ p = "--" + boundary +" \r\nContent-Disposition: form-data; name=\""
|
||
|
this.forEach((value, name) => typeof value == 'string'
|
||
|
- ? chunks.push(p + escape(normalizeLinefeeds(name)) + `"\r\n\r\n${normalizeLinefeeds(value)}\r\n`)
|
||
|
- : chunks.push(p + escape(normalizeLinefeeds(name)) + `"; filename="${escape(value.name)}"\r\nContent-Type: ${value.type||"application/octet-stream"}\r\n\r\n`, value, `\r\n`))
|
||
|
- chunks.push(`--${boundary}--`)
|
||
|
+ ? chunks.push(p + escape(normalizeLinefeeds(name)) + "\"\r\n\r\n" + normalizeLinefeeds(value) + "\r\n")
|
||
|
+ : chunks.push(p + escape(normalizeLinefeeds(name)) + "\"; filename=\"" + escape(value.name) + "\r\nContent-Type: " + (value.type||"application/octet-stream") + "\r\n\r\n", value, "\r\n"))
|
||
|
+ chunks.push("--"+boundary+"--")
|
||
|
return new Blob(chunks, {
|
||
|
type: "multipart/form-data; boundary=" + boundary
|
||
|
})
|
||
|
diff --git a/node_modules/formdata-polyfill/formdata-to-blob.js b/node_modules/formdata-polyfill/formdata-to-blob.js
|
||
|
index 5a0a517..0b7fbd7 100644
|
||
|
--- a/node_modules/formdata-polyfill/formdata-to-blob.js
|
||
|
+++ b/node_modules/formdata-polyfill/formdata-to-blob.js
|
||
|
@@ -16,22 +16,22 @@ const escape = (str, filename) =>
|
||
|
export function formDataToBlob (formData, BlobClass = Blob) {
|
||
|
const boundary = ('----formdata-polyfill-' + Math.random())
|
||
|
const chunks = []
|
||
|
- const prefix = `--${boundary}\r\nContent-Disposition: form-data; name="`
|
||
|
+ const prefix = "--"+$boundary+"\r\nContent-Disposition: form-data; name=\""
|
||
|
|
||
|
for (let [name, value] of formData) {
|
||
|
if (typeof value === 'string') {
|
||
|
- chunks.push(prefix + escape(name) + `"\r\n\r\n${value.replace(/\r(?!\n)|(?<!\r)\n/g, '\r\n')}\r\n`)
|
||
|
+ chunks.push(prefix + escape(name) + "\"\r\n\r\n" + value.replace(/\r(?!\n)|(?<!\r)\n/g, '\r\n') + "\r\n")
|
||
|
} else {
|
||
|
chunks.push(
|
||
|
- prefix + escape(name) + `"; filename="${escape(value.name, 1)}"\r\n` +
|
||
|
- `Content-Type: ${value.type || 'application/octet-stream'}\r\n\r\n`,
|
||
|
+ prefix + escape(name) + "\"; filename=\"" + escape(value.name, 1) + "\r\n" +
|
||
|
+ "Content-Type: " + (value.type || 'application/octet-stream') + "\r\n\r\n",
|
||
|
value,
|
||
|
'\r\n'
|
||
|
)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
- chunks.push(`--${boundary}--`)
|
||
|
+ chunks.push("--" + boundary + "--")
|
||
|
|
||
|
return new BlobClass(chunks, {
|
||
|
type: 'multipart/form-data; boundary=' + boundary
|