From 3eaa61a46350f6a5a7725199ee3110b5f0dd6532 Mon Sep 17 00:00:00 2001 From: Mitsutaka Sato Date: Sun, 28 Feb 2021 07:21:38 +1300 Subject: [PATCH] Set timeout for valid_url (#2552) Co-authored-by: Ahmad Farhat --- app/helpers/application_helper.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index f1d4c2a3..2725e60d 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -110,6 +110,7 @@ module ApplicationHelper # Make a GET request and validate content type http = Net::HTTP.new(url.host, url.port) http.use_ssl = (url.scheme == "https") + http.read_timeout = 10 http.start do |web| response = web.head(url.request_uri)