From 2132599cbb83745ee9bc5edb0f0c9a3d5a70f2f7 Mon Sep 17 00:00:00 2001 From: faketruth Date: Sun, 9 Sep 2012 12:30:16 +0000 Subject: 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 --- WebServer/WebServer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'WebServer') diff --git a/WebServer/WebServer.cpp b/WebServer/WebServer.cpp index c096dcd1d..c0331dc28 100644 --- a/WebServer/WebServer.cpp +++ b/WebServer/WebServer.cpp @@ -348,8 +348,9 @@ void* webserver::Request(void* ptr_s) 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 - 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_ ); Content.insert( 0, "/ ?" ); // Little hack, inserts dummy URL so that SplitGetReq() can work with this content -- cgit v1.2.3