Repository: thrift
Updated Branches:
  refs/heads/master 8b4e155f0 -> 254b4583f


THRIFT-2858 Enable header field case insensitive match in THttpServer

Client: cpp
Patch: YI-HUNG JEN


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/254b4583
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/254b4583
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/254b4583

Branch: refs/heads/master
Commit: 254b4583f74381295ffbe8cf466eb06eb3c0c172
Parents: 8b4e155
Author: Roger Meier <[email protected]>
Authored: Fri Jul 10 15:27:07 2015 +0200
Committer: Roger Meier <[email protected]>
Committed: Fri Jul 10 15:27:07 2015 +0200

----------------------------------------------------------------------
 lib/cpp/src/thrift/transport/THttpServer.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/254b4583/lib/cpp/src/thrift/transport/THttpServer.cpp
----------------------------------------------------------------------
diff --git a/lib/cpp/src/thrift/transport/THttpServer.cpp 
b/lib/cpp/src/thrift/transport/THttpServer.cpp
index 12c55dc..705e34a 100644
--- a/lib/cpp/src/thrift/transport/THttpServer.cpp
+++ b/lib/cpp/src/thrift/transport/THttpServer.cpp
@@ -44,11 +44,11 @@ void THttpServer::parseHeader(char* header) {
   size_t sz = colon - header;
   char* value = colon + 1;
 
-  if (strncmp(header, "Transfer-Encoding", sz) == 0) {
-    if (strstr(value, "chunked") != NULL) {
+  if (strncasecmp(header, "Transfer-Encoding", sz) == 0) {
+    if (strcasestr(value, "chunked") != NULL) {
       chunked_ = true;
     }
-  } else if (strncmp(header, "Content-Length", sz) == 0) {
+  } else if (strncasecmp(header, "Content-length", sz) == 0) {
     chunked_ = false;
     contentLength_ = atoi(value);
   } else if (strncmp(header, "X-Forwarded-For", sz) == 0) {

Reply via email to