response code must be 200 (#2916)

This commit is contained in:
hiroshisuga 2021-09-28 10:30:08 +09:00 committed by GitHub
parent 8d3a3457ad
commit 6e804d550a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -53,6 +53,7 @@ module Joiner
http = Net::HTTP.new(uri.host, uri.port) http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true if uri.scheme == 'https' http.use_ssl = true if uri.scheme == 'https'
response = http.request_head(uri) response = http.request_head(uri)
return false if response.code != "200"
return response['content-length'].to_i < Rails.configuration.max_avatar_size return response['content-length'].to_i < Rails.configuration.max_avatar_size
end end