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:
+1
-1
@@ -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, '');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user