From 39761ce7b83ec5cb35c82b876048ea5e4d170215 Mon Sep 17 00:00:00 2001 From: Felipe Zimmerle Date: Thu, 23 Feb 2017 23:00:01 -0300 Subject: [PATCH] Discards the `charset' from the C-T while checking for body processors Issue #1330 --- src/transaction.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/transaction.cc b/src/transaction.cc index f03a97f7..fb4dabb4 100644 --- a/src/transaction.cc +++ b/src/transaction.cc @@ -541,13 +541,14 @@ int Transaction::addRequestHeader(const std::string& key, if (keyl == "content-type") { std::string multipart("multipart/form-data"); + std::string urlencoded("application/x-www-form-urlencoded;"); std::string l = utils::string::tolower(value); if (l.compare(0, multipart.length(), multipart) == 0) { this->m_requestBodyType = MultiPartRequestBody; m_variableReqbodyProcessor.set("MULTIPART", m_variableOffset); } - if (l == "application/x-www-form-urlencoded") { + if (l.compare(0, urlencoded.length(), urlencoded) == 0) { this->m_requestBodyType = WWWFormUrlEncoded; m_variableReqbodyProcessor.set("URLENCODED", m_variableOffset); }