From 42f4fcff5a21e82f8b6818ab64c3aaee0238e56c Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Tue, 28 Sep 2021 10:31:03 +0900 Subject: [PATCH] URI check only for http or https (#2915) * URI check only for http or https * Update joiner.rb * Update joiner.rb * Update joiner.rb --- app/controllers/concerns/joiner.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/concerns/joiner.rb b/app/controllers/concerns/joiner.rb index 8ab2fcab..a54b48c9 100644 --- a/app/controllers/concerns/joiner.rb +++ b/app/controllers/concerns/joiner.rb @@ -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'