修正重复写入Content-Length的问题

This commit is contained in:
luqiuwen
2019-08-22 11:51:09 +08:00
committed by 陆秋文
parent b689485fea
commit 3a33de4b7c

View File

@@ -1087,6 +1087,9 @@ void hf_private_construct(struct http_half_private * hf_private)
{
const char * __str_content_encoding = __hf_content_encoding_to_str(hf_private->content_encoding);
const static struct http_field_name __cont_encoding_type_name = {TFE_HTTP_CONT_ENCODING, NULL};
/* Delete the origin encoding type, and add a new one */
tfe_http_field_write(hf_public, &__cont_encoding_type_name, NULL);
tfe_http_field_write(hf_public, &__cont_encoding_type_name, __str_content_encoding);
}
@@ -1098,6 +1101,7 @@ void hf_private_construct(struct http_half_private * hf_private)
snprintf(str_sz_evbuf_body, sizeof(str_sz_evbuf_body) - 1, "%lu", evbuffer_get_length(hf_private->evbuf_body));
const static struct http_field_name __cont_encoding_length_name = {TFE_HTTP_CONT_LENGTH, NULL};
tfe_http_field_write(hf_public, &__cont_encoding_length_name, NULL);
tfe_http_field_write(hf_public, &__cont_encoding_length_name, str_sz_evbuf_body);
/* If origin is chunked, now delete chunked tag */