mirror of
https://github.com/tenrok/axios.git
synced 2026-06-20 20:00:40 +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
|
* @returns {String} The String freed of excess whitespace
|
||||||
*/
|
*/
|
||||||
function trim(str) {
|
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