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 URLs containing more than one occurrence of string "http" are rejected #161

Open
tclapython opened this issue Feb 27, 2025 · 0 comments

Comments

@tclapython
Copy link

Describe the bug
Commit 2ac828d "Support pasting multiple URLs in Add form" introduced extractURLs.js which is used to support multiple URL adds.

The link validation is const urlPattern = /https?://[^\s]+/gi;

this seems ok, but later

    .filter(url=>
        (url.match(/https?/g) || []).length == 1 &&
        isURL(url, { require_protocol: true, require_tld: true })

rejects valid URLs that contain the string http more than once. I have some of those in my bookmarks and noticed that new ones were getting rejected in the web UI.
Here are some examples of valid URLs that fail this check:

https://www.google.com/search?q=http
https://web.archive.org/web/20250225043633/https://www.nytimes.com/2025/02/24/science/asteroid-2024-yr4.html
https://www.tutorialspoint.com/http/index.htm

It's not a super crushing work stopper or anything, as I can paste half of the link to get it added, then later edit the link to add the rest and I suppose a different check is used because then it is accepted.

To Reproduce
Steps to reproduce the behavior:

  1. Go to your web app raindrop.io
  2. Click on '+ Add' to add a link
  3. Paste one of the example links above, all of which are valid URLs, into the form
  4. Click "Submit"
  5. Receive error "Please enter a valid URL(s)"

Expected behavior
URLs of this form should be accepted as new link entries

Desktop:

  • OS: Windows 11
  • Browser Brave
  • Version 1.75.181
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

No branches or pull requests

1 participant