fix course link validator
use HEAD instead of GET and accept only gzip compression test plan: - create a page and use these links: - http://www.osa.org/en-us/home/ - http://www.aaes.org/ - start Course Link Validator - the links above should not be listed under broken links fixes CNVS-27460 Change-Id: I8b75b48249b1c8b0e87ee8fa417373357b69462d Reviewed-on: https://gerrit.instructure.com/74461 Tested-by: Jenkins Reviewed-by: James Williams <jamesw@instructure.com> QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com> Product-Review: James Williams <jamesw@instructure.com>
This commit is contained in:
parent
aa0c0c91c4
commit
c22f77ae9a
|
@ -20,6 +20,10 @@ module CanvasHttp
|
|||
CanvasHttp.request(Net::HTTP::Delete, *args, &block)
|
||||
end
|
||||
|
||||
def self.head(*args, &block)
|
||||
CanvasHttp.request(Net::HTTP::Head, *args, &block)
|
||||
end
|
||||
|
||||
def self.get(*args, &block)
|
||||
CanvasHttp.request(Net::HTTP::Get, *args, &block)
|
||||
end
|
||||
|
|
|
@ -273,7 +273,7 @@ class CourseLinkValidator
|
|||
# ping the url and make sure we get a 200
|
||||
def reachable_url?(url)
|
||||
begin
|
||||
response = CanvasHttp.get(url, {}, 9)
|
||||
response = CanvasHttp.head(url, { "Accept-Encoding" => "gzip" }, 9)
|
||||
|
||||
case response.code
|
||||
when /^2/ # 2xx code
|
||||
|
|
Loading…
Reference in New Issue