Class: Metasploit::Aggregator::Http::Request
- Inherits:
-
Object
- Object
- Metasploit::Aggregator::Http::Request
- Defined in:
- lib/metasploit/aggregator/http/request.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#socket ⇒ Object
readonly
Returns the value of attribute socket.
Class Method Summary collapse
-
.parked ⇒ Object
provide a default response in Request form.
- .parse_uri(http_request) ⇒ Object
Instance Method Summary collapse
-
#initialize(request_headers, request_body, socket) ⇒ Request
constructor
A new instance of Request.
Constructor Details
#initialize(request_headers, request_body, socket) ⇒ Request
Returns a new instance of Request.
9 10 11 12 13 |
# File 'lib/metasploit/aggregator/http/request.rb', line 9 def initialize(request_headers, request_body, socket) @headers = request_headers @body = request_body @socket = socket end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
6 7 8 |
# File 'lib/metasploit/aggregator/http/request.rb', line 6 def body @body end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
5 6 7 |
# File 'lib/metasploit/aggregator/http/request.rb', line 5 def headers @headers end |
#socket ⇒ Object (readonly)
Returns the value of attribute socket.
7 8 9 |
# File 'lib/metasploit/aggregator/http/request.rb', line 7 def socket @socket end |
Class Method Details
.parked ⇒ Object
provide a default response in Request form
27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/metasploit/aggregator/http/request.rb', line 27 def self.parked() = [] << 'HTTP/1.1 200 OK' << 'Content-Type: application/octet-stream' << 'Connection: close' << 'Server: Apache' << 'Content-Length: 0' << ' ' << ' ' self.new(, '', nil) end |
.parse_uri(http_request) ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/metasploit/aggregator/http/request.rb', line 15 def self.parse_uri(http_request) req = http_request.headers[0] parts = req.split(/ /) uri = nil if parts.length >= 2 uri = req.split(/ /)[1] uri = uri.chomp('/') end uri end |