LemmyNet/lemmy

[Bug]: Blocked URLs accept HTTP and HTTPS URLs that are otherwise the same as separate entries

SleeplessOne1917 opened this issue · 1 comments

Requirements

  • Is this a bug report? For questions or discussions use https://lemmy.ml/c/lemmy_support
  • Did you check to see if this issue already exists?
  • Is this only a single bug? Do not put multiple bugs in one issue.
  • Do you agree to follow the rules in our Code of Conduct?
  • Is this a backend issue? Use the lemmy-ui repo for UI / frontend issues.

Summary

As described in the title. If you have https://somedomain/some_path, it will not cover http://somedomain/some_path.

Steps to Reproduce

  1. (Must be admin) got to site settings
  2. Enter both http and https versions of the same URL into the Blocked URLs textarea.
  3. Save changes
  4. Refresh page if updates doesn't show
  5. Check blocked URLs section again

Technical Details

n/a

Version

0.19.4-beta.4

Lemmy Instance URL

voyager.lemmy.ml

As part of this , since we've already parsed them as urls, we could just keep everything past the domain. So even if a user saves https://google.com/....other_stuff, as part of that validation function, it rewrites it to google.com/....