Skip to content

Properly detect if domain is served by pages for non-200 response codes #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 12, 2015

Conversation

benbalter
Copy link
Contributor

Before we were using response.success? which returns false for non-200 response codes including 30x and 40x status.

Even if a GitHub Pages site isn't set up (e.g., / 404s), theserved_by_pages?` check should still be able to determine if it's the Pages server, so long as we're able to connect and we don't time out.

Note, when mocking response, response.return_code appears to be nil.

Cribbed from https://github.com/typhoeus/typhoeus/blob/35a4d5b6f7c818a0c11b0c1e10a20b30c754e169/lib/typhoeus/response/status.rb#L48-L50.

@benbalter benbalter self-assigned this Aug 12, 2015
benbalter added a commit that referenced this pull request Aug 12, 2015
Properly detect if domain is served by pages for non-200 response codes
@benbalter benbalter merged commit cd336bd into master Aug 12, 2015
@benbalter benbalter deleted the served-by-pages-404 branch August 12, 2015 15:23
benbalter added a commit that referenced this pull request Aug 12, 2015
@benbalter
Copy link
Contributor Author

Test added via 6def034.

parkr added a commit that referenced this pull request Jan 12, 2016
* master: (28 commits)
  travis: use Ruby 2.1.7
  Upgrade to Ruby 2.1.7-github per https://pages.github.com/versions/
  💎 bump
  Memoize served_by_pages? == false
  Memoize dns = nil
  typo in comment
  💎 bump
  actually check that a domains dns resolves
  💎 bump
  add invalid_dns.rb to gemspec
  add timeout to DNS check
  add script/check
  💎 bump
  require net-dns 0.8
  add check for #26
  💎 bump
  properly detect if domain is served by pages for non-200 response codes
  💎 bump
  remove some diff noise
  use addressable::uri to support domains with underscores
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant