Class: Aquatone::Detectors::Heroku

Inherits:
Aquatone::Detector show all
Defined in:
lib/aquatone/detectors/heroku.rb

Constant Summary collapse

CNAME_VALUES =
%w(.herokudns.com .herokussl.com .herokuapp.com).freeze
RESPONSE_FINGERPRINT =
"<title>No such app</title>".freeze

Instance Attribute Summary

Attributes inherited from Aquatone::Detector

#host, #resource

Instance Method Summary collapse

Methods inherited from Aquatone::Detector

descendants, #initialize, meta, meta=, #positive?, sluggified_name

Constructor Details

This class inherits a constructor from Aquatone::Detector

Instance Method Details

#runObject



14
15
16
17
18
19
20
21
22
# File 'lib/aquatone/detectors/heroku.rb', line 14

def run
  return false unless cname_resource?
  CNAME_VALUES.each do |cname_value|
    if resource_value.end_with?(cname_value)
      return get_request("http://#{host}/").body.include?(RESPONSE_FINGERPRINT)
    end
  end
  false
end