Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URL pathname and search setter incorrectly strips trailing spaces #847

Closed
lucacasonato opened this issue Jul 10, 2023 · 0 comments · Fixed by #848
Closed

URL pathname and search setter incorrectly strips trailing spaces #847

lucacasonato opened this issue Jul 10, 2023 · 0 comments · Fixed by #848

Comments

@lucacasonato
Copy link
Collaborator

Test case:

const url = new URL('http://example.com/');
url.pathname = '/ ';
url.search = '? ';
url.hash = '# ';
console.log(url.href);

Implementations:

// whatwg-url@13.0.0
"http://example.com/%20?%20#%20" ✅

// Chrome 117.0.5881.0
"http://example.com/%20?%20#%20" ✅

// Firefox 114.0.2
"http://example.com/%20?%20#%20" ✅

// Safari TP 171
"http://example.com/?#%20" ❌

// Deno 1.35.0 (rust-url 2.4.0)
"http://example.com/?%20#%20" ❌

// [node@20.4.0](mailto:node@20.4.0)
"http://example.com/%20?%20#%20" ✅

New tests in web-platform-tests/wpt#40959

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant