summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2018-03-26 20:21:06 -0400
committerAdam <Adam@anope.org>2018-03-26 20:21:06 -0400
commitd25722ddd0766cba2c33614e326d241d3f1f7eeb (patch)
treeefef2d4cc3826fb4c5a9bdaeb4ac785e1b3544fd
parent1baf774647f138a080b38aab6beeb8626f32abed (diff)
m_httpd: make http headers case insensitive
-rw-r--r--include/modules/httpd.h2
-rw-r--r--modules/m_httpd.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/include/modules/httpd.h b/include/modules/httpd.h
index 861702cec..6f71014ae 100644
--- a/include/modules/httpd.h
+++ b/include/modules/httpd.h
@@ -23,7 +23,7 @@ struct HTTPReply
{
HTTPError error;
Anope::string content_type;
- std::map<Anope::string, Anope::string> headers;
+ std::map<Anope::string, Anope::string, ci::less> headers;
typedef std::list<std::pair<Anope::string, Anope::string> > cookie;
std::vector<cookie> cookies;
diff --git a/modules/m_httpd.cpp b/modules/m_httpd.cpp
index 193da975a..45bad002e 100644
--- a/modules/m_httpd.cpp
+++ b/modules/m_httpd.cpp
@@ -199,7 +199,7 @@ class MyHTTPClient : public HTTPClient
this->page = this->provider->FindPage(targ);
this->page_name = targ;
}
- else if (buf.find("Cookie: ") == 0)
+ else if (buf.find_ci("Cookie: ") == 0)
{
spacesepstream sep(buf.substr(8));
Anope::string token;
@@ -215,7 +215,7 @@ class MyHTTPClient : public HTTPClient
this->message.cookies[token.substr(0, sz)] = token.substr(sz + 1, end);
}
}
- else if (buf.find("Content-Length: ") == 0)
+ else if (buf.find_ci("Content-Length: ") == 0)
{
try
{