Method: Excon::Utils#split_header_value

Defined in:
lib/excon/utils.rb

#split_header_value(str) ⇒ Object

Splits a header value str according to HTTP specification.



57
58
59
60
61
62
63
# File 'lib/excon/utils.rb', line 57

def split_header_value(str)
  return [] if str.nil?
  str = str.dup.strip
  str.force_encoding('BINARY') if FORCE_ENC
  str.scan(%r'\G((?:"(?:\\.|[^"])+?"|[^",]+)+)
                (?:,\s*|\Z)'xn).flatten
end