bugfix: TSG-12514 HTTP解析层未处理chunk编码的POST数据
This commit is contained in:
@@ -308,8 +308,15 @@ static int __parser_callback_on_headers_complete(http_parser * parser)
|
|||||||
/* Does not contain a content-length, passthrough the whole TCP connection */
|
/* Does not contain a content-length, passthrough the whole TCP connection */
|
||||||
if (unlikely(__str_content_length == NULL))
|
if (unlikely(__str_content_length == NULL))
|
||||||
{
|
{
|
||||||
hf_private->is_passthrough = true;
|
const struct http_field_name __transfer_encoding_field_name = {TFE_HTTP_TRANSFER_ENCODING, NULL};
|
||||||
return -1;
|
char *__str_transfer_encoding = (char *)tfe_http_field_read(hf_public, &__transfer_encoding_field_name);
|
||||||
|
if (!(__str_transfer_encoding && strncasecmp(__str_transfer_encoding, "chunked", strlen("chunked")) == 0))
|
||||||
|
{
|
||||||
|
const char * __str_stream = hf_private->session->hc_private->stream->str_stream_info;
|
||||||
|
TFE_LOG_ERROR(g_http_plugin->logger, "the content-length and transfer-encoding field not set, passthrough the whole tcp connection: %s. ", __str_stream);
|
||||||
|
hf_private->is_passthrough = true;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user