apfeltee/clearsilver

parse information from http post

GoogleCodeExporter opened this issue · 3 comments

What steps will reproduce the problem?
1. write cgi with python and use neo_cgi.so
2. use firefox and request cgi with post method
3. check out the hdf

What is the expected output? What do you see instead?
we expected parsed information( key/value) from the post,but nothing  

What version of the product are you using? On what operating system?
clearsilver-0.10.5 linux  

Please provide any additional information below.

cgi/cgi.c  line: 643 

from :
    if (type && !strcmp(type, "application/x-www-form-urlencoded" )

change to :
    if (type && !strncmp(type, "application/x-www-form-urlencoded",33))


firefox send post like this :
    Content-Type: application/x-www-form-urlencoded; charset=UTF-8


Original issue reported on code.google.com by mya...@gmail.com on 12 Oct 2011 at 12:11

But chrome is ok

HTTP_USER_AGENT=Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.1 (KHTML, like 
Gecko) Chrome/21.0.1180.89 Safari/537.1
CONTENT_TYPE=application/x-www-form-urlencoded

I can get HTTP Form POST via Query.XXX

https://github.com/xiangzhai/xcloud/blob/master/test/hellofcgi.cpp

Original comment by xiangzha...@gmail.com on 29 Sep 2012 at 2:16

  • Added labels: ****
  • Removed labels: ****
HTTP POST testcase 
https://github.com/xiangzhai/xcloud/blob/master/test/hellofcgi.cpp

and I emerge www-client/firefox-15.0.1 under Gentoo Linux, as the attachment 
shown: CONTENT_TYPE=application/x-www-form-urlencoded, but without 
"charset=UTF-8"

Original comment by xiangzha...@gmail.com on 20 Oct 2012 at 3:05

  • Added labels: ****
  • Removed labels: ****

Attachments:

sorry about the late reply.

chrome may ok because "Content-Type: application/x-www-form-urlencoded",
but firefox is "Content-Type: application/x-www-form-urlencoded;
charset=UTF-8".

fix the cgi.c and it will works well for both

Original comment by mya...@gmail.com on 18 Oct 2012 at 2:19

  • Added labels: ****
  • Removed labels: ****