Skip to content

Commit f9d5f27

Browse files
committed
Instead of being an error, store wildcard error as a warning
1 parent b79489b commit f9d5f27

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/github-pages-health-check/domain.rb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class Domain < Checkable
9696
should_be_a_record? cname_to_github_user_domain? cname_to_domain_to_pages?
9797
cname_to_pages_dot_github_dot_com? cname_to_fastly?
9898
pointed_to_github_pages_ip? non_github_pages_ip_present? pages_domain?
99-
served_by_pages? valid? reason valid_domain? https?
99+
served_by_pages? valid? reason warnings valid_domain? https?
100100
enforces_https? https_error https_eligible? caa_error dns_zone_soa? dns_zone_ns?
101101
].freeze
102102

@@ -113,6 +113,7 @@ def initialize(host, nameservers: :default)
113113
@nameservers = nameservers
114114
@resolver = GitHubPages::HealthCheck::Resolver.new(self.host,
115115
:nameservers => nameservers)
116+
@warnings = {}
116117
end
117118

118119
# Runs all checks, raises an error if invalid
@@ -126,12 +127,17 @@ def check!
126127
raise Errors::InvalidCNAMEError.new :domain => self if invalid_cname?
127128
raise Errors::InvalidAAAARecordError.new :domain => self if invalid_aaaa_record?
128129
raise Errors::NotServedByPagesError.new :domain => self unless served_by_pages?
129-
raise Errors::WildcardRecordError.new(:domain => self, :parent_domain => parent_domain) if maybe_wildcard?
130+
131+
warnings[Errors::WildCardRecordError] = Errors::WildcardRecordError.new(:domain => self, :parent_domain => parent_domain) if maybe_wildcard?
130132

131133
true
132134
end
133135
# rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
134136

137+
def warnings
138+
@warnings.values
139+
end
140+
135141
def deprecated_ip?
136142
return @deprecated_ip if defined? @deprecated_ip
137143

0 commit comments

Comments
 (0)