[openstreetmap/openstreetmap-website] Ensure that urls are only valid if the entire string is a url (#2578)

Andy Allan notifications at github.com
Wed Apr 1 15:37:41 UTC 2020


Replacement PR for #2557 

The previous regexps only checked that the string started with a url, but would accept further input.

The validates_url gem works well, but only with the inclusion of https://github.com/perfectline/validates_url/pull/85 which is not yet in a release. I'm not sure if it's better to wait for a release, or go with the git link for the gem.

There's also the fact that validates_url doesn't appear to support arbitrary schemes (e.g. `myapp://`) so I've used the underlying regexp for that.


You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/2578

-- Commit Summary --

  * Ensure that urls are only valid if the entire string is a url

-- File Changes --

    M Gemfile (1)
    M Gemfile.lock (9)
    M app/models/client_application.rb (7)
    M test/models/client_application_test.rb (6)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/2578.patch
https://github.com/openstreetmap/openstreetmap-website/pull/2578.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/2578
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20200401/bf911c64/attachment.htm>


More information about the rails-dev mailing list