Skip to content

Commit

Permalink
Merge pull request #147 from github/update_https_rules
Browse files Browse the repository at this point in the history
check for underscore for https
  • Loading branch information
yoannchaudet authored Oct 11, 2022
2 parents e1d29db + 396fb6d commit 67abe4a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
5 changes: 4 additions & 1 deletion lib/github-pages-health-check/domain.rb
Original file line number Diff line number Diff line change
Expand Up @@ -449,8 +449,11 @@ def enforces_https?
def https_eligible?
# Can't have any IP's which aren't GitHub's present.
return false if non_github_pages_ip_present?
# Must be a CNAME or point to our IPs.

# Can't have underscores in the domain name (Let's Encrypt does not allow it)
return false if host.include?("_")

# Must be a CNAME or point to our IPs.
# Only check the one domain if a CNAME. Don't check the parent domain.
return true if cname_to_github_user_domain?

Expand Down
2 changes: 1 addition & 1 deletion lib/github-pages-health-check/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

module GitHubPages
module HealthCheck
VERSION = "1.18.0"
VERSION = "1.18.1"
end
end
6 changes: 6 additions & 0 deletions spec/github_pages_health_check/domain_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1042,6 +1042,12 @@

it { is_expected.to be_https_eligible }

context "with underscore domain" do
let(:domain) { "foo_bar.com" }

it { is_expected.not_to be_https_eligible }
end

context "with bad CAA records" do
let(:caa_domain) { "digicert.com" }
before(:each) { allow(subject.send(:caa)).to receive(:query) { [caa_packet] } }
Expand Down

0 comments on commit 67abe4a

Please sign in to comment.