File tree 3 files changed +8
-4
lines changed
lib/github-pages-health-check
spec/github_pages_health_check
3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -245,13 +245,17 @@ def cname_to_github_user_domain?
245
245
246
246
# Check if the CNAME points to a Domain that points to pages
247
247
# e.g. CNAME -> Domain -> Pages
248
+ # rubocop:disable Metrics/AbcSize
248
249
def cname_to_domain_to_pages?
250
+ return false unless dns?
251
+
249
252
a_record_to_pages = dns . select { |d | d . type == Dnsruby ::Types ::A && d . name . to_s == host } . first
250
253
251
254
return false unless a_record_to_pages && cname? && !cname_to_pages_dot_github_dot_com? && @www_cname
252
255
253
256
CURRENT_IP_ADDRESSES . include? ( a_record_to_pages . address . to_s . downcase )
254
257
end
258
+ # rubocop:enable Metrics/AbcSize
255
259
256
260
# Is the given domain a CNAME to pages.github.(io|com)
257
261
# instead of being CNAME'd to the user's subdomain?
Original file line number Diff line number Diff line change 2
2
3
3
module GitHubPages
4
4
module HealthCheck
5
- VERSION = "1.18.4 "
5
+ VERSION = "1.18.5 "
6
6
end
7
7
end
Original file line number Diff line number Diff line change 671
671
end
672
672
end
673
673
674
- context "Protocol redirections" do
674
+ context "Protocol redirections" , :retry => 3 , :retry_wait => 1 do
675
675
before do
676
676
@out = [ ]
677
677
@@ -724,7 +724,7 @@ def stop
724
724
@servers . each ( &:stop )
725
725
end
726
726
727
- it "it does not follow anything other than http/https by default" , :retry => 3 do
727
+ it "it does not follow anything other than http/https by default" do
728
728
Typhoeus . get (
729
729
"http://localhost:#{ @servers [ 1 ] . port } " ,
730
730
GitHubPages ::HealthCheck . typhoeus_options
@@ -733,7 +733,7 @@ def stop
733
733
expect ( @out ) . to_not include ( "HIT #{ @servers [ 0 ] . port } " )
734
734
end
735
735
736
- it "it follows ftp if requested (negative test)" , :retry => 3 do
736
+ it "it follows ftp if requested (negative test)" do
737
737
Typhoeus . get (
738
738
"http://localhost:#{ @servers [ 1 ] . port } " ,
739
739
GitHubPages ::HealthCheck . typhoeus_options . merge ( :redir_protocols => %i[ http https ftp ] )
You can’t perform that action at this time.
0 commit comments