Set timeout for valid_url (#2552)

Co-authored-by: Ahmad Farhat <ahmad.af.farhat@gmail.com>
This commit is contained in:
Mitsutaka Sato 2021-02-28 07:21:38 +13:00 committed by GitHub
parent 09ab074aaf
commit 3eaa61a463
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -110,6 +110,7 @@ module ApplicationHelper
# Make a GET request and validate content type # Make a GET request and validate content type
http = Net::HTTP.new(url.host, url.port) http = Net::HTTP.new(url.host, url.port)
http.use_ssl = (url.scheme == "https") http.use_ssl = (url.scheme == "https")
http.read_timeout = 10
http.start do |web| http.start do |web|
response = web.head(url.request_uri) response = web.head(url.request_uri)