Hello.
When using HTTP-REQUEST for non text content types, we
have following error in CLISP:
SYSTEM::STORE: #\< does not fit into #(0 0 0 0 0 0 0 0 0 0 ...), bad type
Backtrace:
0: INVOKE-DEBUGGER
1: SYSTEM::STORE
2: EXT:READ-CHAR-SEQUENCE
3: READ-SEQUENCE
4: DRAKMA::READ-BODY
5: DRAKMA::HTTP-REQUEST-FINISH-REQUEST
6: unwind-protect frame
7: compiled block frame for HTTP-REQUEST
8: HTTP-REQUEST
This is because CLISP doesn't support READ-SEQUENCE on
a stream having STREAM-ELEMENT-TYPE == 'CHARACTER.
The patch attached fixes this problem by explicit change
of stream element type in the DRAKMA::READ-BODY function.
Test URLs:
http://www.google.com/calendar/feeds/pm55j8kg30dnm54ib2if9fuocc@group.calen…http://www.lisperati.com/lisplogo_alien_128.png
Best regards,
-- Anton
Hello,
I believe the following behaviour is a bug:
(drakma::parse-set-cookie "session=\"1,2,3\"; domain=example.com;
path=/")
generates an error:
While parsing cookie header "session=\"1,2,3\"; domain=example.com; path=/":
Read character #\,, but expected #\=.
[Condition of type SIMPLE-ERROR]
Restarts:
0: [ABORT] Return to SLIME's top level.
1: [TERMINATE-THREAD] Terminate this thread (#<THREAD "new-repl-thread" {1004560551}>)
Backtrace:
0: (CHUNGA::SIGNAL-UNEXPECTED-CHARS #\, #\=)
1: (CHUNGA:ASSERT-CHAR #<SB-IMPL::STRING-INPUT-STREAM {1004562A51}> #\=)
2: (CHUNGA:READ-NAME-VALUE-PAIR #<SB-IMPL::STRING-INPUT-STREAM {1004562A51}>)[:EXTERNAL]
3: (DRAKMA::PARSE-SET-COOKIE "session=\"1,2,3\"; domain=example.com;
path=/")
According to RFC2965[1],
av-pairs = av-pair *(";" av-pair)
av-pair = attr ["=" value] ; optional value
attr = token
value = token | quoted-string
value is either a token or a quoted string. According to RFC2616[2],
quoted-string = ( <"> *(qdtext | quoted-pair ) <"> )
qdtext = <any TEXT except <">>
quoted string can contain any text except \", including
commas.
I know a particular web-site (reddit.com) that sets cookies of that
form, and Firefox parses them without any problem.
The problem seem to be in read-name-value-pair from CHUNGA:
DRAKMA> (with-input-from-string (in "session=\"1,2,3\";
domain=example.com; path=/") (read-name-value-pair in :cookie-syntax t))
("session" . "\"1")
Best Regards,
Victor.
[1] http://www.faqs.org/rfcs/rfc2965.html
[2] http://www.faqs.org/rfcs/rfc2616.html
--
http://macrodefinition.blogspot.com