Skip to content

Commit 8d86d52

Browse files
committed
Fix detection of multiple Transfer-Encoding headers
1 parent 05d4991 commit 8d86d52

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/http.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4003,17 +4003,20 @@ do_http (POUND_HTTP *phttp)
40034003
case HEADER_TRANSFER_ENCODING:
40044004
if ((val = http_header_get_value (hdr)) == NULL)
40054005
goto err;
4006-
if (!strcasecmp ("chunked", val))
4007-
chunked = 1;
4008-
else
4006+
if (chunked)
40094007
{
40104008
logmsg (LOG_NOTICE,
4011-
"(%"PRItid") e400 multiple Transfer-encoding \"%s\" from %s",
4009+
"(%"PRItid") e400 multiple Transfer-encoding: chunked on \"%s\" from %s",
40124010
POUND_TID (), phttp->request.url,
40134011
addr2str (caddr, sizeof (caddr), &phttp->from_host, 1));
40144012
http_err_reply (phttp, HTTP_STATUS_BAD_REQUEST);
40154013
return;
40164014
}
4015+
else
4016+
{
4017+
if (!strcasecmp ("chunked", val))
4018+
chunked = 1;
4019+
}
40174020
break;
40184021

40194022
case HEADER_CONTENT_LENGTH:

0 commit comments

Comments
 (0)