diff --git a/lib/utils.js b/lib/utils.js index 18de154541..c43710e196 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -210,7 +210,7 @@ var isURLSearchParams = kindOfTest('URLSearchParams'); * @returns {String} The String freed of excess whitespace */ function trim(str) { - return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, ''); + return str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); } /**