Exception: Dobby::VulnSource::Debian::BadResponseError

Inherits:
Error
  • Object
show all
Defined in:
lib/dobby/vuln_source/debian.rb

Overview

Received a non-200 response from the Security Tracker

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#curlObject

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

#contextHash{resp_code=>Integer, url=>String, resp=>String}

Returns:

  • (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