From dea4829786a5651b9d42142235e5f2a0221a29d5 Mon Sep 17 00:00:00 2001 From: antao Date: Fri, 10 Aug 2018 17:16:37 +0800 Subject: [PATCH] Fix Content-Type bug --- lib/src/HttpRequestImpl.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/src/HttpRequestImpl.cc b/lib/src/HttpRequestImpl.cc index 10a661d6..cb006d76 100755 --- a/lib/src/HttpRequestImpl.cc +++ b/lib/src/HttpRequestImpl.cc @@ -30,7 +30,11 @@ using namespace drogon; void HttpRequestImpl::parsePremeter() { - const std::string &type=getHeader("Content-Type"); + std::string type=getHeader("Content-Type"); + if(type.empty()) + { + type=getHeader("content-type"); + } const std::string &input=query(); if(_method==kGet||(_method==kPost&&(type==""||type.find("application/x-www-form-urlencoded")!=std::string::npos))) {