Selaa lähdekoodia

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 vuotta sitten
vanhempi
commit
1b5ad92459
1 muutettua tiedostoa jossa 2 lisäystä ja 1 poistoa
  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, ':');
         if(colon == NULL)
             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);
             break;