Skip to content

Commit

Permalink
Security fix for ReDoS (axios#3980)
Browse files Browse the repository at this point in the history
  • Loading branch information
ready-research committed Aug 30, 2021
1 parent b5a7cc2 commit 1cff872
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/utils.js
Expand Up @@ -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, '');
}

/**
Expand Down

0 comments on commit 1cff872

Please sign in to comment.