Module: Rack::Httperflog::UrlHelper
Instance Method Summary collapse
-
#url_status_is?(status, host, port, path) ⇒ Boolean
Checks if the status code returned by a GET to host:port/path is the one provided in the first param.
Instance Method Details
#url_status_is?(status, host, port, path) ⇒ Boolean
Checks if the status code returned by a GET to host:port/path is the one provided in the first param.
119 120 121 |
# File 'lib/rack/httperflog.rb', line 119 def url_status_is?(status, host, port, path) Net::HTTP.start(host, port) {|http| http.get(path) }.code.to_s.strip == status.to_s rescue false end |