Module: Strelka::Constants::CookieHeader

Included in:
Strelka::Cookie
Defined in:
lib/strelka/constants.rb

Overview

Constants for parsing Cookie headers, mostly taken from RFC6265 - HTTP State Management Mechanism

http://tools.ietf.org/html/rfc6265

Constant Summary collapse

CRLF =

Literals

"\r\n"
WSP =
'[\\x20\\t]'
OBS_FOLD =

OWS = *( [ obs-fold ] WSP ) ; "optional" whitespace obs-fold = CRLF

CRLF
OWS =
/(#{OBS_FOLD}#{WSP})*/
CTL =

CTL = <any US-ASCII control character (octets 0 - 31) and DEL (127)>

'[:cntrl:]'
SEPARATORS =

separators = "(" | ")" | "<" | ">" | "@" | "," | ";" | ":" | "" | <"> | "/" | "[" | "]" | "?" | "=" | "| "" | SP | HT

'\\x28\\x29\\x3c\\x3e\\x40' +
'\\x2c\\x3b\\x3a\\x5c\\x22' +
'\\x2f\\x5b\\x5d\\x3f\\x3d' +
'\\x7b\\x7d\x20\x09'
DQUOTE =

Double-quote

'"'
TOKEN =

token = 1*

%r{ [^#{CTL}#{SEPARATORS}]+ }x
/(?<cookie_name>#{TOKEN})/
'[\x21\x23-\x2b\x2d-\x3a\x3c-\x5b\x5d-\x7e]'
%r{(?<cookie_value>
  #{COOKIE_OCTET}*
  |
  #{DQUOTE} #{COOKIE_OCTET}*? #{DQUOTE}
)}x
%r{(?<cookie_pair>
  #{COOKIE_NAME}
  =
  #{COOKIE_VALUE}
)}x
/;\s*Version=(?<version>\d+)/i