8000 Security fix for ReDoS (#3980) · darth-coder-js/axios@5b45711 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5b45711

Browse files
Security fix for ReDoS (axios#3980)
1 parent 5bc9ea2 commit 5b45711

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ function isURLSearchParams(val) {
185185
* @returns {String} The String freed of excess whitespace
186186
*/
187187
function trim(str) {
188-
return str.replace(/^\s*/, '').replace(/\s*$/, '');
188+
return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, '');
189189
}
190190

191191
/**

0 commit comments

Comments
 (0)
0