Hot!HTTP Net Server parses the HTTP header case sensitive

Author
David Green
Junior Member
  • Total Posts : 27
  • Reward points : 0
  • Joined: 2017/04/10 07:57:13
  • Location: 0
  • Status: offline
2018/09/26 04:28:46 (permalink)
5 (4)

HTTP Net Server parses the HTTP header case sensitive

The HTTP NET Server is incorrectly parsing the HTTP Headers Case-Sensitive.
The RFC states, that all HTTP headers are case-insensitive.
Found in Harmony 2.04 and still present in Harmony 2.06.
(Harmony 2.06 http_net.c Lines 1840 to 1849)

        
parseFail = false;
        for(ix = 0; ix < sizeof(HTTPRequestHeaders)/sizeof(HTTPRequestHeaders[0]); ix++)
        {
            if(strcmp((char*)buffer, (const char *)HTTPRequestHeaders[ix]) == 0)
            { // Parse the header and stop the loop
                parseFail = _HTTP_HeaderParseLookup(pHttpCon, ix) == false;
                clearLine = true;
                break;
            }
        }


Simply replace "strcmp" with "strcasecmp" or a different case insensitive function.

While 90% of the HTTP Client Frameworks are using for example "Content-Length", we just came across a framework that sends "content-length". And it is correct in doing so.

Please fix this for the next harmony release and check all other places where the header is parsed. :)
#1

2 Replies Related Threads

    moser
    Super Member
    • Total Posts : 394
    • Reward points : 0
    • Joined: 2015/06/16 02:53:47
    • Location: Germany
    • Status: offline
    Re: HTTP Net Server parses the HTTP header case sensitive 2018/09/26 06:47:15 (permalink)
    0
    #2
    rainad
    Moderator
    • Total Posts : 1015
    • Reward points : 0
    • Joined: 2009/05/01 13:39:25
    • Location: 0
    • Status: offline
    Re: HTTP Net Server parses the HTTP header case sensitive 2018/09/26 08:52:16 (permalink)
    4 (1)
    Yes, good catch.
    Thanks for finding and reporting this.
    It will be fixed ASAP.
     
    #3
    Jump to:
    © 2018 APG vNext Commercial Version 4.5