forked from External/greenlight
Set timeout for valid_url (#2552)
Co-authored-by: Ahmad Farhat <ahmad.af.farhat@gmail.com>
This commit is contained in:
parent
09ab074aaf
commit
3eaa61a463
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue