Class: DumbHttp::BaseMessage

Inherits:
BinData::Record
  • Object
show all
Defined in:
lib/binproxy/parsers/dumb_http.rb

Direct Known Subclasses

BinMessage, Message

Instance Method Summary collapse

Instance Method Details

#body_lenObject



13
14
15
# File 'lib/binproxy/parsers/dumb_http.rb', line 13

def body_len
  (headers.snapshot.grep(/\AContent-Length: (\d+)/) { $1.to_i }).first || 0
end

#summaryObject



17
# File 'lib/binproxy/parsers/dumb_http.rb', line 17

def summary; headers.first.sub(/HTTP\/\d\.\d/,'').strip; end