Skip to content

Commit 0c62906

Browse files
vikivivipaulbartell
authored andcommitted
Fix header field parser using case-insensitive compare
1 parent 3908d64 commit 0c62906

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

source/core_http_client.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2235,8 +2235,9 @@ static int findHeaderFieldParserCallback( http_parser * pHttpParser,
22352235
assert( pContext->valueFound == 0U );
22362236

22372237
/* Check whether the parsed header matches the header we are looking for. */
2238+
/* Each header field consists of a case-insensitive field name (RFC 7230, section 3.2). */
22382239
if( ( fieldLen == pContext->fieldLen ) &&
2239-
( strncmp( pContext->pField, pFieldLoc, fieldLen ) == 0 ) )
2240+
( strncasecmp( pContext->pField, pFieldLoc, fieldLen ) == 0 ) )
22402241
{
22412242
LogDebug( ( "Found header field in response: "
22422243
"HeaderName=%.*s, HeaderLocation=0x%p",

0 commit comments

Comments
 (0)