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

Message option skipped if invalid URI #122

Closed
JoeWoodward opened this issue Jun 2, 2021 · 0 comments · Fixed by #155
Closed

Message option skipped if invalid URI #122

JoeWoodward opened this issue Jun 2, 2021 · 0 comments · Fixed by #155

Comments

@JoeWoodward
Copy link

I'm not actually using the gem but I was looking how it's implemented and noticed that when rescue URI::InvalidURIError is triggered you are applying :url instead of options.fetch(:message)

https://github.com/perfectline/validates_url/blob/master/lib/validate_url.rb#L66

jaynetics added a commit to jaynetics/validates_url that referenced this issue Oct 22, 2024
fixes perfectline#122.

I could only run the specs by removing Gemfile.lock and would recommend perfectline#150 to be merged before this PR.

Several examples were red with NoMethodErrors before I made any changes. I had to add the `value && ` to fix that.

The example `does not allow a url with only a scheme` was also red. I had to add the `host.empty?` check to fix that one.
kritik pushed a commit that referenced this issue Oct 22, 2024
fixes #122.

I could only run the specs by removing Gemfile.lock and would recommend #150 to be merged before this PR.

Several examples were red with NoMethodErrors before I made any changes. I had to add the `value && ` to fix that.

The example `does not allow a url with only a scheme` was also red. I had to add the `host.empty?` check to fix that one.
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 a pull request may close this issue.

1 participant