1
0

Core's Web Chat should work on FireFox again. Apparently it appends "charset=utf-8" to the content type which was not properly handled.

Right now any trailing data in the content type is ignored, which seems to work

git-svn-id: http://mc-server.googlecode.com/svn/trunk@857 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
faketruth 2012-09-09 12:30:16 +00:00
parent 92c7d48af0
commit 2132599cbb

View File

@ -348,8 +348,9 @@ void* webserver::Request(void* ptr_s)
if( (req.method_.compare("POST") == 0) && (req.content_length_ > 0) ) if( (req.method_.compare("POST") == 0) && (req.content_length_ > 0) )
{ {
const char FormUrlEncoded[] = "application/x-www-form-urlencoded";
// The only content type we can parse at the moment, the default HTML post data // The only content type we can parse at the moment, the default HTML post data
if( req.content_type_.compare( "application/x-www-form-urlencoded" ) == 0 ) if( req.content_type_.substr(0, strlen(FormUrlEncoded)).compare( FormUrlEncoded ) == 0 )
{ {
std::string Content = s->ReceiveBytes( req.content_length_ ); std::string Content = s->ReceiveBytes( req.content_length_ );
Content.insert( 0, "/ ?" ); // Little hack, inserts dummy URL so that SplitGetReq() can work with this content Content.insert( 0, "/ ?" ); // Little hack, inserts dummy URL so that SplitGetReq() can work with this content