Skip to content

Commit cd336bd

Browse files
committed
Merge pull request #26 from github/served-by-pages-404
Properly detect if domain is served by pages for non-200 response codes
2 parents 0b73e97 + 83ab8e7 commit cd336bd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/github-pages-health-check.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@ def served_by_pages?
150150
if response.mock? && response.headers["Location"]
151151
response = Typhoeus.head(response.headers["Location"], TYPHOEUS_OPTIONS)
152152
end
153-
response.success? && response.headers["Server"] == "GitHub.com"
153+
154+
(response.mock? || response.return_code == :ok) && response.headers["Server"] == "GitHub.com"
154155
end
155156

156157
def to_json

0 commit comments

Comments
 (0)