i have jumped too far into the bright future of the internet and found RFC 6265 to be an active standards about 50 years too early
This commit is contained in:
parent
0a6defe61d
commit
a15e531fdc
|
@ -115,6 +115,8 @@ module Landline
|
|||
|
||||
data.split(";").map do |cookiestr|
|
||||
key, value = cookiestr.match(/([^=]+)=?(.*)/).to_a[1..].map(&:strip)
|
||||
next unless key and value
|
||||
|
||||
cookie = Cookie.new(key, value)
|
||||
if hash[cookie.key]
|
||||
hash[cookie.key].append(cookie)
|
||||
|
|
|
@ -15,12 +15,16 @@ module Landline
|
|||
PRINTCHAR = /[\x2-\x7E]/
|
||||
# Matches 1 or more CHARs excluding CTLs
|
||||
PRINTABLE = /#{PRINTCHAR}+/o
|
||||
# !! RFC 6265 IS PROPOSED AND NOT AN IMPLEMENTED STANDARD YET !!
|
||||
# Matches the RFC6265 definition of a cookie-octet
|
||||
COOKIE_OCTET = /[\x21-\x7E&&[^",;\\]]*/
|
||||
COOKIE_VALUE = /(?:#{QUOTED}|#{COOKIE_OCTET})/o
|
||||
COOKIE_NAME = TOKEN
|
||||
# COOKIE_VALUE = /(?:#{QUOTED}|#{COOKIE_OCTET})/o
|
||||
# COOKIE_NAME = TOKEN
|
||||
# Matches the RFC6265 definition of cookie-pair.
|
||||
# Captures name (1) and value (2).
|
||||
# !! RFC 6265 IS PROPOSED AND NOT AN IMPLEMENTED STANDARD YET !!
|
||||
COOKIE_OCTET = /[\x21-\x7E&&[^",;\\]]*/
|
||||
COOKIE_NAME = /[^;,=\s]*/
|
||||
COOKIE_VALUE = /[^;,\s]*/
|
||||
COOKIE_PAIR = /\A(#{COOKIE_NAME})=(#{COOKIE_VALUE})\z/o
|
||||
# Matches a very abstract definition of a quoted header paramter.
|
||||
# Captures name (1) and value (2).
|
||||
|
|
Loading…
Reference in New Issue