From 31d5d790896c6c3932db4f109b7f0ed17aa2c593 Mon Sep 17 00:00:00 2001 From: Felipe Zimmerle Date: Wed, 7 Dec 2016 15:59:20 -0300 Subject: [PATCH] Removes charset=UTF-8 from content-type variable --- src/transaction.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/transaction.cc b/src/transaction.cc index 72633911..463d7fe5 100644 --- a/src/transaction.cc +++ b/src/transaction.cc @@ -962,7 +962,12 @@ int Transaction::addResponseHeader(const std::string& key, this->m_collections.store("RESPONSE_HEADERS:" + key, value); if (utils::string::tolower(key) == "content-type") { - this->m_responseContentType->assign(value); + // Removes the charset=... + // Content-Type: text/html; charset=UTF-8 + std::vector val = utils::string::split(value, ';'); + if (val.size() > 0) { + this->m_responseContentType->assign(val[0]); + } } return 1; }