Cookies often have quoted-strings, as described in http://www.w3.org/Protocols/rfc2109/rfc2109 . This patch adds quoted string support to the auxiliary cookie parsing functionality provided by Chunga.
*crossing my fingers that I formatted the patch properly* - Red
--- read.lisp 2010-05-17 03:24:35.532650280 -0700 +++ /tmp/chunga-1.1.0/read.lisp 2009-12-01 13:58:01.000000000 -0800 @@ -246,16 +246,12 @@ (defun read-cookie-value (stream &key (separators ";")) "Reads a cookie parameter value from STREAM which is returned as a string. Simply reads until a semicolon is seen \(or an element of -SEPARATORS). Also reads quoted strings if the first non-whitespace -character is a quotation mark \(as in RFC 2109) at -http://www.w3.org/Protocols/rfc2109/rfc2109" - (if (char= #\" (peek-char* stream)) - (read-quoted-string stream) - (trim-whitespace - (with-output-to-string (out) - (loop for char = (peek-char* stream nil) - until (or (null char) (find char separators :test #'char=)) - do (write-char (read-char* stream) out)))))) +SEPARATORS)." + (trim-whitespace + (with-output-to-string (out) + (loop for char = (peek-char* stream nil) + until (or (null char) (find char separators :test #'char=)) + do (write-char (read-char* stream) out))))) (defun read-name-value-pair (stream &key (value-required-p t) cookie-syntax) "Reads a typical \(in RFC 2616) name/value or attribute/value
_______________________________________________ drakma-devel mailing list drakma-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/drakma-devel