github-pages-health-check 1.17.9 → 1.18.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4c5eb1174f9f171c28477d1971a3272da065cf3af53241759fd7e2f9f19fa513
4
- data.tar.gz: 9a5b9221d8fc8dae3834f960203f8cfd0342e0796051165e3b79bb9a31c305a4
3
+ metadata.gz: 4c192823fd967f8d554b5eaa42b7e3eeac0a59a0456859f0617e1e5c44b9073c
4
+ data.tar.gz: 69f956e87a2bc17ea4a64ef3aa01f29215bd0fe8c9cccacd32275a16bd6be4bd
5
5
  SHA512:
6
- metadata.gz: 8e5fe1e4172bb296dd1a3814914d2949fe4c4d50f7cb384dbfb0adad7d364f99913ae7c040d90bb362cf8bdbe37b7e7db01deace5773ce73c78d70879da23b07
7
- data.tar.gz: ee584b59c168c47c194af89b9ed79c6911573acb277fd65fb4dbbaa4f227fce56779a5a88af5c676b537011daacf16ec6190f388f27ef47b37fb9f25fd3557b3
6
+ metadata.gz: '0489d4d0a0d3df987f2cd47d414afca1933ccc2391b9d323ce17c8d8f3d0fe140244cca097689e913b5d6f5e7d7e7462628fed3c2f3d4eb2419340c87f0f3c76'
7
+ data.tar.gz: cb3f76bc01a5e55bdbab02072f749480787af86ee37e609c218fb38552835f2ce4e8292c0fb6b54e0eed4196969d0fdbe64f2c861aa005bb01df3870256cf110
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.7.1
1
+ 3.1.2
@@ -4,6 +4,8 @@
4
4
  103.245.222.0/23
5
5
  103.245.224.0/24
6
6
  104.156.80.0/20
7
+ 140.248.64.0/18
8
+ 140.248.128.0/17
7
9
  146.75.0.0/17
8
10
  151.101.0.0/16
9
11
  157.52.64.0/18
@@ -449,8 +449,11 @@ module GitHubPages
449
449
  def https_eligible?
450
450
  # Can't have any IP's which aren't GitHub's present.
451
451
  return false if non_github_pages_ip_present?
452
- # Must be a CNAME or point to our IPs.
453
452
 
453
+ # Can't have underscores in the domain name (Let's Encrypt does not allow it)
454
+ return false if host.include?("_")
455
+
456
+ # Must be a CNAME or point to our IPs.
454
457
  # Only check the one domain if a CNAME. Don't check the parent domain.
455
458
  return true if cname_to_github_user_domain?
456
459
 
@@ -482,12 +485,12 @@ module GitHubPages
482
485
  def response
483
486
  return @response if defined? @response
484
487
 
485
- @response = Typhoeus.head(uri, TYPHOEUS_OPTIONS)
488
+ @response = Typhoeus.head(uri, GitHubPages::HealthCheck.typhoeus_options)
486
489
 
487
490
  # Workaround for webmock not playing nicely with Typhoeus redirects
488
491
  # See https://github.com/bblimke/webmock/issues/237
489
492
  if @response.mock? && @response.headers["Location"]
490
- @response = Typhoeus.head(response.headers["Location"], TYPHOEUS_OPTIONS)
493
+ @response = Typhoeus.head(response.headers["Location"], GitHubPages::HealthCheck.typhoeus_options)
491
494
  end
492
495
 
493
496
  @response
@@ -495,13 +498,13 @@ module GitHubPages
495
498
 
496
499
  # The domain's response to HTTP requests, without following redirects
497
500
  def http_response
498
- options = TYPHOEUS_OPTIONS.merge(:followlocation => false)
501
+ options = GitHubPages::HealthCheck.typhoeus_options.merge(:followlocation => false)
499
502
  @http_response ||= Typhoeus.head(uri(:scheme => "http"), options)
500
503
  end
501
504
 
502
505
  # The domain's response to HTTPS requests, without following redirects
503
506
  def https_response
504
- options = TYPHOEUS_OPTIONS.merge(:followlocation => false)
507
+ options = GitHubPages::HealthCheck.typhoeus_options.merge(:followlocation => false)
505
508
  @https_response ||= Typhoeus.head(uri(:scheme => "https"), options)
506
509
  end
507
510
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module GitHubPages
4
4
  module HealthCheck
5
- VERSION = "1.17.9"
5
+ VERSION = "1.18.1"
6
6
  end
7
7
  end
@@ -41,16 +41,6 @@ module GitHubPages
41
41
  URL = "https://github.com/github/pages-health-check"
42
42
  USER_AGENT = "Mozilla/5.0 (compatible; #{HUMAN_NAME}/#{VERSION}; +#{URL})"
43
43
 
44
- TYPHOEUS_OPTIONS = {
45
- :followlocation => true,
46
- :timeout => TIMEOUT,
47
- :accept_encoding => "gzip",
48
- :method => :head,
49
- :headers => {
50
- "User-Agent" => USER_AGENT
51
- }
52
- }.freeze
53
-
54
44
  # surpress warn-level feedback due to unsupported record types
55
45
  def self.without_warnings(&block)
56
46
  warn_level = $VERBOSE
@@ -63,5 +53,27 @@ module GitHubPages
63
53
  def self.check(repository_or_domain, access_token: nil)
64
54
  Site.new repository_or_domain, :access_token => access_token
65
55
  end
56
+
57
+ # rubocop:disable Naming/AccessorMethodName (this is not an accessor method)
58
+ def self.set_proxy(proxy_url)
59
+ @typhoeus_options = typhoeus_options.merge(:proxy => proxy_url).freeze
60
+ nil
61
+ end
62
+ # rubocop:enable Naming/AccessorMethodName
63
+
64
+ def self.typhoeus_options
65
+ return @typhoeus_options if defined?(@typhoeus_options)
66
+
67
+ @typhoeus_options = {
68
+ :followlocation => true,
69
+ :timeout => TIMEOUT,
70
+ :accept_encoding => "gzip",
71
+ :method => :head,
72
+ :headers => {
73
+ "User-Agent" => USER_AGENT
74
+ },
75
+ :proxy => nil
76
+ }.freeze
77
+ end
66
78
  end
67
79
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: github-pages-health-check
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.17.9
4
+ version: 1.18.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitHub, Inc.
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-01 00:00:00.000000000 Z
11
+ date: 2022-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -145,7 +145,7 @@ homepage: https://github.com/github/github-pages-health-check
145
145
  licenses:
146
146
  - MIT
147
147
  metadata: {}
148
- post_install_message:
148
+ post_install_message:
149
149
  rdoc_options: []
150
150
  require_paths:
151
151
  - lib
@@ -160,8 +160,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
160
160
  - !ruby/object:Gem::Version
161
161
  version: '0'
162
162
  requirements: []
163
- rubygems_version: 3.2.9
164
- signing_key:
163
+ rubygems_version: 3.3.7
164
+ signing_key:
165
165
  specification_version: 4
166
166
  summary: Checks your GitHub Pages site for commons DNS configuration issues
167
167
  test_files: []