URI check only for http or https (#2915)

* URI check only for http or https

* Update joiner.rb

* Update joiner.rb

* Update joiner.rb
This commit is contained in:
hiroshisuga 2021-09-28 10:31:03 +09:00 committed by GitHub
parent 6e804d550a
commit 42f4fcff5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -48,7 +48,7 @@ module Joiner
end
def valid_avatar?(url)
return false if URI.regexp.match(url).nil?
return false if URI.regexp(['http', 'https']).match(url).nil?
uri = URI(url)
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true if uri.scheme == 'https'