Skip to content

Commit

Permalink
Update url-state-machine.js
Browse files Browse the repository at this point in the history
  • Loading branch information
ShiyuBanzhou authored Jan 29, 2025
1 parent dadf181 commit c5cec47
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/url-state-machine.js
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ function domainToASCII(domain, beStrict = false) {
}

function trimControlChars(url) {
return url.replace(/^[\u0000-\u001F\u0020]+$/ug, "");
return url.replace(/^[\u0000-\u001F\u0020]+|(?:[^\u0000-\u001F\u0020][\u0000-\u001F\u0020]+)$/ug, "");
}

function trimTabAndNewline(url) {
Expand Down

0 comments on commit c5cec47

Please sign in to comment.