update electron to v43

This commit is contained in:
olcxja 2026-07-09 22:38:33 +02:00
commit fb6c8b6ee9
5385 changed files with 513060 additions and 123058 deletions

View file

@ -15,6 +15,18 @@ var setToStringTag = require('es-set-tostringtag');
var hasOwn = require('hasown');
var populate = require('./populate.js');
/**
* Escape CR, LF, and `"` in a multipart `name`/`filename` parameter, so a field
* name or filename can not break out of its header line to inject headers or
* smuggle additional parts. Matches the WHATWG HTML multipart/form-data encoding.
*
* @param {string} str - the parameter value to escape
* @returns {string} the escaped value
*/
function escapeHeaderParam(str) {
return String(str).replace(/\r/g, '%0D').replace(/\n/g, '%0A').replace(/"/g, '%22');
}
/**
* Create readable "multipart/form-data" streams.
* Can be used to submit forms
@ -180,7 +192,7 @@ FormData.prototype._multiPartHeader = function (field, value, options) {
var contents = '';
var headers = {
// add custom disposition as third element or keep it two elements if not
'Content-Disposition': ['form-data', 'name="' + field + '"'].concat(contentDisposition || []),
'Content-Disposition': ['form-data', 'name="' + escapeHeaderParam(field) + '"'].concat(contentDisposition || []),
// if no content type. allow it to be empty array
'Content-Type': [].concat(contentType || [])
};
@ -234,7 +246,7 @@ FormData.prototype._getContentDisposition = function (value, options) { // eslin
}
if (filename) {
return 'filename="' + filename + '"';
return 'filename="' + escapeHeaderParam(filename) + '"';
}
};