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

Better URL handling #321

Open
N-Coder opened this issue Mar 10, 2022 · 3 comments
Open

Better URL handling #321

N-Coder opened this issue Mar 10, 2022 · 3 comments

Comments

@N-Coder
Copy link
Member

N-Coder commented Mar 10, 2022

Using urllib's ParseResult as sole data type for representing URL attributes is probably not the best and most flexible way, so we should evaluate ways of letting the user chose how to handle URLs as there is a plethora of different ways and libraries for representing URLs. See e.g. here:

The "mailto" being converted to lowercase probably comes from using python's built-in urlparse to represent the URLs. One could probably use one of many other libraries (rfc3986, rfc3987, hyperlink, furl, ...) as a replacement that might allow customizing this, but I haven't looked into that. The biggest issue there is probably deciding which one to use / how to support multiple of these libraries.

@make-github-pseudonymous-again
Copy link
Contributor

Why not just a string? Can keep parsing for validation.

@make-github-pseudonymous-again
Copy link
Contributor

I mean the part that makes sure the URL has valid format can stay hidden inside the implementation but the return value should be the original slice of input without modifications? What about URL encoded values? Mmmh...

@make-github-pseudonymous-again
Copy link
Contributor

If the URL format is such that the raw string can be pasted into a browser URL bar then I do not see why we would not return the original string slice.

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

No branches or pull requests

3 participants