Module: ICAPrb::Server::Parser
- Included in:
- HTTPHeaderParser, ICAPRequestParser
- Defined in:
- lib/icaprb/server/request_parser.rb
Overview
The Parser module contains methods to parse ICAP or HTTP messages.
Defined Under Namespace
Modules: ChunkedEncodingHelper Classes: HTTP_Parse_Error, ICAP_Parse_Error
Instance Method Summary collapse
-
#parse_header(line) ⇒ Object
parse header line and returns the parsed line as Array which has the name on index 0 and the value on index 1.
Instance Method Details
#parse_header(line) ⇒ Object
parse header line and returns the parsed line as Array which has the name on index 0 and the value on index 1
53 54 55 56 57 58 |
# File 'lib/icaprb/server/request_parser.rb', line 53 def parse_header(line) # remove newlines line = line.gsub!("\r",'') line = line.gsub!("\n",'') line.split(':',2).map {|x| x.strip} end |