<div dir="ltr"><div>Hm... this may or may not be relevant, but I had a problem somewhere in the intersection of drakma, chunga and (possibly) hunchentoot, which turned out to be caused by drakma treating "application/xml" as a binary format. While checking my mailbox to aid my recollection of this, I came across <a href="https://github.com/edicl/hunchentoot/issues/1">https://github.com/edicl/hunchentoot/issues/1</a> .<br>
<br></div><div>For *my* problem, the solution was simply to add <br><br>(pushnew (cons "application" "xml") <br> drakma:*text-content-types* :test 'equalp)<br><br></div><div>in the startup block of my code. <br>
</div><div><br></div>Again, I'm not sure if any of this is relevant :-)<br><div>
<div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, May 22, 2013 at 7:15 AM, Jingtao Xu <span dir="ltr"><<a href="mailto:jingtaozf@gmail.com" target="_blank">jingtaozf@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Hans,<br>
<br>
As hunchentoot have not logged them to message.log,I could not give<br>
out the content-type header to you.<br>
And this bug don't appear always,so I have no way reproduce this bug<br>
at this time.<br>
<br>
But I have made some patch to chunga and hunchentoot by cloning the repository:<br>
<a href="https://github.com/jingtaozf/chunga/commits/master" target="_blank">https://github.com/jingtaozf/chunga/commits/master</a><br>
<a href="https://github.com/jingtaozf/hunchentoot/commits/master" target="_blank">https://github.com/jingtaozf/hunchentoot/commits/master</a><br>
<br>
<br>
With Best Regards,<br>
jingtao.<br>
<div><div><br>
<br>
On Wed, May 22, 2013 at 1:03 PM, Hans Hübner <<a href="mailto:hans.huebner@gmail.com" target="_blank">hans.huebner@gmail.com</a>> wrote:<br>
> Jingtao,<br>
><br>
> thank you for your bug report. Can you please share the actual value of the<br>
> Content-type header that triggered the bug?<br>
><br>
> Thanks,<br>
> Hans<br>
><br>
><br>
> On Wed, May 22, 2013 at 4:28 AM, Jingtao Xu <<a href="mailto:jingtaozf@gmail.com" target="_blank">jingtaozf@gmail.com</a>> wrote:<br>
>><br>
>> Hi All,<br>
>><br>
>> My website use hunchentoot and allow some external website post url<br>
>> request to hunchentoot server(which is necessary),and I found an error<br>
>> log in message.log:<br>
>><br>
>> ---------------------------------------------------<br>
>> Error when reading POST parameters from body: Corrupted Content-Type<br>
>> header:<br>
>> Read character #\/, but expected #\=.<br>
>> ---------------------------------------------------<br>
>><br>
>> I found this bug is caused in function parse-content-type when it want<br>
>> to get parameters<br>
>> by calling function read-name-value-pairs then read-name-value-pair,in<br>
>> lisp function read-name-value-pair,there exist an assert which raise<br>
>> this exception:<br>
>><br>
>> ------------------------------------------<br>
>> (when (or value-required-p<br>
>> (eql (peek-char* stream nil) #\=))<br>
>> (assert-char stream #\=)<br>
>> ------------------------------------------<br>
>><br>
>> And this will make hunchentoot thread stop the request processing and<br>
>> exit,which is wrong.<br>
>><br>
>> When I have a deep investigation,I found that this bug should be<br>
>> caused by package chuga<br>
>> when try to read-token,its function token-char-p will call function<br>
>> separatorp and allow character #\/<br>
>> as a token character,which is not practical well,because both java and<br>
>> ruby and many other launguage don't allow them as a token<br>
>> character,more details you can get in a discussion:<br>
>><br>
>> <a href="http://bugs.python.org/issue2193" target="_blank">http://bugs.python.org/issue2193</a><br>
>><br>
>> and a java implemention of token-char-p is like this:<br>
>><br>
>> -------------------------------------------------------------<br>
>><br>
>> private static final String tspecials = ",; ";<br>
>><br>
>> private boolean isToken(String value) {<br>
>> int len = value.length();<br>
>> for (int i = 0; i < len; i++) {<br>
>> char c = value.charAt(i);<br>
>> if (c < 0x20 || c >= 0x7f || tspecials.indexOf(c) != -1)<br>
>> return false;<br>
>> }<br>
>> return true;<br>
>> }<br>
>> -------------------------------------------------------------<br>
>><br>
>> Anyway, hunchentoot should not raise an exception in<br>
>> parse-content-type,which make my site could not receive user's<br>
>> request.<br>
>> And to be more compatible with other web client/server, hunchentoot<br>
>> should read token<br>
>> like java/ruby.<br>
>><br>
>> Hope some patch can be done to package chunga and hunchentoot to fix my<br>
>> issue.<br>
>><br>
>> With Best Regards,<br>
>> jingtao.<br>
>><br>
><br>
<br>
</div></div></blockquote></div><br></div></div></div></div></div></div>