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

Trailing whitespace in domain name is URL encoded #656

Closed
acidus99 opened this issue Mar 4, 2024 · 2 comments
Closed

Trailing whitespace in domain name is URL encoded #656

acidus99 opened this issue Mar 4, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@acidus99
Copy link

acidus99 commented Mar 4, 2024

I noticed that if you have trailing whitespace in the domain name, it gets URL encoded

If you put this URL into the address bar: gemini://gemi.dev Lagrange converts the trailing space into %20, creating the invalid domain name gemi.dev%20 and displays an error:

image

I noticed this while copy+pasting a URL, which seems like a common probably where whitespace might accidentally get copied.

Consider having Lagrange to trim trailing whitespace off the URL. If you don't want to do this (so that people could have a file reachable at gemini://example.com/%20 then consider trimming whitespace where it would not be allowed. In this case, in the domain name.

@skyjake skyjake added the bug Something isn't working label Mar 5, 2024
@skyjake
Copy link
Owner

skyjake commented Mar 5, 2024

I think it wouldn't hurt to trim whitespace from text pasted into URL fields. IIRC that's already done in the mobile ports. Maybe the URL handling code could simply reject domain names with illegal characters like whitespace.

@zzo38
Copy link

zzo38 commented Mar 13, 2024

I think it makes sense to trim spaces at the beginning and end of the URL. If you deliberately want a space at the beginning or end of a URL, you can type %20 instead.

@skyjake skyjake closed this as completed Oct 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants