bugcgicc - Bugs: bug #25073, query string is incorrectly...

 
 

bug #25073: query string is incorrectly parsed, when post enctype is multipart/form-data

Submitted by:  None
Submitted on:  Fri 12 Dec 2008 12:40:49 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: sebastien diaz <sebdiaz>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 12 Dec 2008 12:40:49 AM UTC, original submission:

It is because Cgicc::parseFormInput parses everything as fEnvironment.getContentType() (which returns "multipart/form-data" for given requests), while query string is always encoded as application/x-www-form-urlencoded.

Check attached files.

This can be easily fixed by moving content_type (Cgicc::parseFormInput) variable out as function argument, optionaly with default value "application/x-www-form-urlencoded".

//Cgicc.h

void
parseFormInput(const std::string& data, const std::string& content_type = "application/x-www-form-urlencoded");

//Cgicc.cpp

void
cgicc::Cgicc::parseFormInput(const std::string& data, const std::string &content_type)
{
std::string standard_type = "application/x-www-form-urlencoded";
std::string multipart_type = "multipart/form-data";

//Cgicc.cpp, Cgicc::parseFormInput call pairs

cgicc::Cgicc::Cgicc(CgiInput *input)
: fEnvironment(input)
{
// this can be tweaked for performance
fFormData.reserve(20);
fFormFiles.reserve(2);

parseFormInput(fEnvironment.getPostData(), fEnvironment.getContentType());
parseFormInput(fEnvironment.getQueryString());
}

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #17032:  index.html added by None (327B - text/html)
file #17033:  main.cpp added by None (594B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 5 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Wed 21 Jan 2009 09:15:50 PM UTCsebdiazOpen/ClosedOpen=>Closed
Sat 03 Jan 2009 05:12:20 PM UTCsebdiazStatusNone=>Fixed
Sun 28 Dec 2008 09:09:55 AM UTCsebdiazAssigned toNone=>sebdiaz
Fri 12 Dec 2008 12:40:49 AM UTCNoneAttached File-=>Added index.html, #17032
  Attached File-=>Added main.cpp, #17033

Back to the top


Powered by Savane 3.1-cleanup1