refactor url validator to use sanitizer for check

This commit is contained in:
James Lopez
2016-07-01 09:02:45 +02:00
parent 26ce833a21
commit 54a50bf81d
+1 -3
View File
@@ -35,9 +35,7 @@ class AddressableUrlValidator < ActiveModel::EachValidator
end
def valid_uri?(value)
Addressable::URI.parse(value).is_a?(Addressable::URI)
rescue Addressable::URI::InvalidURIError
false
Gitlab::UrlSanitizer.valid?(value)
end
def valid_protocol?(value)