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

valid URL containing an underscore cannot be added #206

Open
gingerbeardman opened this issue Feb 22, 2022 · 8 comments
Open

valid URL containing an underscore cannot be added #206

gingerbeardman opened this issue Feb 22, 2022 · 8 comments
Labels
bug Something isn't working

Comments

@gingerbeardman
Copy link
Contributor

gingerbeardman commented Feb 22, 2022

From #202

Confirming a valid URL containing an _ (underscore) cannot be added to the system

Screenshot

Screenshot 2022-02-22 at 16 56 45

Example URLs

Bug

So there is a problem with the process of checking a URLs, as both of the above are valid.

@sissbruecker
Copy link
Owner

Yeah, URL validation is not perfect, and from what I understand this is quite opinionated. For now linkding just uses the default Djanog URL validator, so you could also report it there. As a workaround linkding provides an option to disable URL validation: https://github.com/sissbruecker/linkding/blob/master/docs/Options.md#ld_disable_url_validation

@sissbruecker sissbruecker added the bug Something isn't working label May 14, 2022
@gingerbeardman
Copy link
Contributor Author

gingerbeardman commented May 15, 2022

Django won't fix, since 10 years

https://code.djangoproject.com/ticket/18517

@gingerbeardman
Copy link
Contributor Author

gingerbeardman commented May 18, 2023

I'm here one year later trying linkding again (thanks to Browser Companion app for iOS/macOS) and these two URLs failed to import again, not that I expected it to have changed.

I'm trying a workaround encoding the underscore as %5F

I was able to add them as wayback machine versions.

eg

https://web.archive.org/web/20230504175240/http://infoseek_rip.g.ribbon.to/crspalm.hp.infoseek.co.jp/

😄

@gingerbeardman
Copy link
Contributor Author

gingerbeardman commented Jan 23, 2025

Here's another one:


Yeah, URL validation is not perfect, and from what I understand this is quite opinionated. For now linkding just uses the default Djanog URL validator, so you could also report it there. As a workaround linkding provides an option to disable URL validation:
https://github.com/sissbruecker/linkding/blob/master/docs/Options.md#ld_disable_url_validation

The above link has since been broken (quick google) it's now at:

https://github.com/sissbruecker/linkding/blob/master/docs/src/content/docs/options.md

@webysther
Copy link

Switch to use https://github.com/python-validators/validators/ can be the trick, support very well RFC and can be used to expand in future to support another types of url like custom schema and local uri using feature-flag.

@webysther
Copy link

I'm here one year later trying linkding again (thanks to Browser Companion app for iOS/macOS) and these two URLs failed to import again, not that I expected it to have changed.

I'm trying a workaround encoding the underscore as %5F

I was able to add them as wayback machine versions.

eg

https://web.archive.org/web/20230504175240/http://infoseek_rip.g.ribbon.to/crspalm.hp.infoseek.co.jp/

😄

Why not disable the validation to keep using it?

@webysther
Copy link

One important point: this is not fully the same as #957 because the point about the another one is not validation is similarity support to avoid more wide duplicate than strict equal-only check.

@gingerbeardman
Copy link
Contributor Author

gingerbeardman commented Jan 24, 2025

I simply do not want to turn off validation, though I might change my mind about that in the future.

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