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

Validate URLs using Addressable gem to allow non-ascii characters (closes #111) #112

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

goulvench
Copy link

Warning: this allows a lot more URLs.
There is not valid? method on Addressable::URI, because many strings can be parsed and considered valid.
See twingly/twingly-url#74 (comment)
This change requires a minor version bump, along with a bundle install warning I think.

@goulvench goulvench changed the title Validate URLs using Addressable gem to allow non-ascii characters Validate URLs using Addressable gem to allow non-ascii characters (Fixes #111) Mar 19, 2022
@goulvench goulvench changed the title Validate URLs using Addressable gem to allow non-ascii characters (Fixes #111) Validate URLs using Addressable gem to allow non-ascii characters (closes #111) Mar 19, 2022
@@ -67,7 +82,7 @@ def build_ftp_record
describe "for invalid urls" do
it "rejects invalid urls" do
subject = build_url_record
subject.url = 'http://^^^^.fr'
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

http://^^^^.fr is considered valid by Addressable, which strictly adheres to the RFC. Spaces are not allowed though.

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

Successfully merging this pull request may close these issues.

1 participant