2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-02 16:04:10 +03:00

Security fix for ReDoS (#3980)

This commit is contained in:
ready-research
2021-08-30 18:03:43 +05:30
committed by GitHub
parent 5bc9ea24dd
commit 5b457116e3
+1 -1
View File
@@ -185,7 +185,7 @@ function isURLSearchParams(val) {
* @returns {String} The String freed of excess whitespace
*/
function trim(str) {
return str.replace(/^\s*/, '').replace(/\s*$/, '');
return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, '');
}
/**