aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarlson2k <k2k@narod.ru>2014-01-09 21:48:17 +0400
committerKarlson2k <k2k@narod.ru>2014-05-05 01:11:10 +0400
commit7e6039091ed3695aac01c28454c0094e759e0df5 (patch)
treeb4a61e0ee42db63016d0bc6cc206a2073ac88cc2
parent82800cc496c457b553a25ac3376db0aafb2c1152 (diff)
HttpHeader::GetHeader: (used only in tests) return empty string if got nothing and use standard "\r\n" line ending
-rw-r--r--xbmc/utils/HttpHeader.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/xbmc/utils/HttpHeader.cpp b/xbmc/utils/HttpHeader.cpp
index 27f25799d3..1671f04061 100644
--- a/xbmc/utils/HttpHeader.cpp
+++ b/xbmc/utils/HttpHeader.cpp
@@ -164,12 +164,15 @@ std::vector<std::string> CHttpHeader::GetValues(std::string strParam) const
std::string CHttpHeader::GetHeader(void) const
{
- std::string strHeader(m_protoLine + '\n');
+ if (m_protoLine.empty() && m_params.empty())
+ return "";
+
+ std::string strHeader(m_protoLine + "\r\n");
for (HeaderParams::const_iterator iter = m_params.begin(); iter != m_params.end(); ++iter)
- strHeader += ((*iter).first + ": " + (*iter).second + "\n");
+ strHeader += ((*iter).first + ": " + (*iter).second + "\r\n");
- strHeader += "\n";
+ strHeader += "\r\n";
return strHeader;
}