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] Add tests for trailing spaces on setters #40959

Merged
merged 1 commit into from Jul 11, 2023
Merged

Conversation

lucacasonato
Copy link
Member

Adding some tests around trailing spaces and C0 control characters for pathname,
search, and hash setters, because some implementations incorrectly strip them.

Simplified 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
"http://example.com/?%20#%20" 

// node@20.4.0
"http://example.com/%20?%20#%20" 

@lucacasonato
Copy link
Member Author

@domenic domenic merged commit 01b31f8 into master Jul 11, 2023
19 checks passed
@domenic domenic deleted the trailing_space_url branch July 11, 2023 01:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants