Browse Source

HPCC-11996 Read correct HTTP header for AcceptLanguage

The existing ESP does not read correct HTTP header for
AcceptLanguage. It returns the 'Accept' header due to a
bug.

Signed-off-by: wangkx <kevin.wang@lexisnexis.com>
wangkx 11 years ago
parent
commit
1b5ad92459
1 changed files with 2 additions and 1 deletions
  1. 2 1
      esp/bindings/http/platform/httptransport.cpp

+ 2 - 1
esp/bindings/http/platform/httptransport.cpp

@@ -1028,7 +1028,8 @@ StringBuffer& CHttpMessage::getHeader(const char* headername, StringBuffer& head
         const char* colon = strchr(header, ':');
         const char* colon = strchr(header, ':');
         if(colon == NULL)
         if(colon == NULL)
             continue;
             continue;
-        if(strncmp(headername, header, colon - header) == 0)
+        unsigned len = colon - header;
+        if((strlen(headername) == len) && (strncmp(headername, header, len) == 0))
         {
         {
             headerval.append(colon + 2);
             headerval.append(colon + 2);
             break;
             break;