From 3a33de4b7cf71d2f88f1be5f60192d1541396386 Mon Sep 17 00:00:00 2001 From: luqiuwen Date: Thu, 22 Aug 2019 11:51:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E9=87=8D=E5=A4=8D=E5=86=99?= =?UTF-8?q?=E5=85=A5Content-Length=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/protocol/http/src/http_half.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugin/protocol/http/src/http_half.cpp b/plugin/protocol/http/src/http_half.cpp index 6a05f1a..d35f507 100644 --- a/plugin/protocol/http/src/http_half.cpp +++ b/plugin/protocol/http/src/http_half.cpp @@ -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 */