From 03366588a9dfe96c81a4c5ab3ab99f19b1828ad1 Mon Sep 17 00:00:00 2001 From: rylek Date: Mon, 29 Aug 2011 21:03:08 +0000 Subject: [PATCH] .Web/httpsrv.cpp: minor fixes in POST data handling git-svn-id: svn://ultimatepp.org/upp/trunk@3795 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/Web/httpsrv.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/uppsrc/Web/httpsrv.cpp b/uppsrc/Web/httpsrv.cpp index 091d2bf99..06e73e44e 100644 --- a/uppsrc/Web/httpsrv.cpp +++ b/uppsrc/Web/httpsrv.cpp @@ -664,12 +664,15 @@ One HttpServer::GetRequest() } { String content = request_query.GetString("$$CONTENT_TYPE"); + static const char utag[] = "application/x-www-form-urlencoded"; static const char mtag[] = "multipart/"; request_query.Set("$$POSTDATA", post_data); - if(!socket.IsError() && strnicmp(content, mtag, 10)) - request_query.SetURL(post_data); - else - GetHttpPostData(request_query, post_data); + if(!socket.IsError()) { + if(!CompareNoCase(content, utag)) + request_query.SetURL(post_data); + else if(!strnicmp(content, mtag, 10)) + GetHttpPostData(request_query, post_data); + } One req = new HttpRequest(*this, conn, request_query); req->LogTime(GetHttpURI(request_query), 1); return req;