Exception: Dobby::VulnSource::Debian::BadResponseError
- Defined in:
- lib/dobby/vuln_source/debian.rb
Overview
Received a non-200 response from the Security Tracker
Instance Attribute Summary collapse
-
#curl ⇒ Object
Returns the value of attribute curl.
Instance Method Summary collapse
- #context ⇒ Hash{resp_code=>Integer, url=>String, resp=>String}
-
#initialize(curl) ⇒ BadResponseError
constructor
A new instance of BadResponseError.
Constructor Details
#initialize(curl) ⇒ BadResponseError
Returns a new instance of BadResponseError.
57 58 59 60 61 62 |
# File 'lib/dobby/vuln_source/debian.rb', line 57 def initialize(curl) url = curl.url url_path_only = url =~ /\A([^?]*)\?/ ? Regexp.last_match(1) : url super("Bad response code (#{curl.response_code.to_i} for #{url_path_only})") @curl = curl end |
Instance Attribute Details
#curl ⇒ Object
Returns the value of attribute curl.
55 56 57 |
# File 'lib/dobby/vuln_source/debian.rb', line 55 def curl @curl end |
Instance Method Details
#context ⇒ Hash{resp_code=>Integer, url=>String, resp=>String}
65 66 67 |
# File 'lib/dobby/vuln_source/debian.rb', line 65 def context { resp_code: @curl.response_code, url: @curl.url, resp: @curl.body_str } end |