From f01fd2adc7dd7773de8db183791cffb5fe11e1fb Mon Sep 17 00:00:00 2001 From: luqiuwen Date: Thu, 10 Jan 2019 15:48:22 +0600 Subject: [PATCH] =?UTF-8?q?Close=20#109=20=E4=BF=AE=E6=AD=A3302=E9=87=8D?= =?UTF-8?q?=E5=AE=9A=E5=90=91=E5=9C=A8Firefox=E6=B5=8F=E8=A7=88=E5=99=A8?= =?UTF-8?q?=E4=B8=8B=E8=B7=B3=E8=BD=AC=E7=BC=93=E6=85=A2=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20*=20Firefox=E8=A6=81=E6=B1=82302=E5=BA=94=E7=AD=94?= =?UTF-8?q?=E4=BD=93=E5=BF=85=E9=A1=BB=E5=8C=85=E5=90=ABContent-Length?= =?UTF-8?q?=EF=BC=8C=E5=90=A6=E5=88=99=E6=97=A0=E6=B3=95=E6=AD=A3=E7=A1=AE?= =?UTF-8?q?=E5=A4=84=E7=90=86=E6=B6=88=E6=81=AF=E4=BD=93=20*=20=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0302=E5=BA=94=E7=AD=94=E7=9A=84Content-Length=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=EF=BC=8C=E5=A1=AB=E4=B8=BA0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/business/pangu-http/src/pangu_http.cpp | 1 + plugin/protocol/http/src/http_half.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/plugin/business/pangu-http/src/pangu_http.cpp b/plugin/business/pangu-http/src/pangu_http.cpp index bcef5cb..c671bc2 100644 --- a/plugin/business/pangu-http/src/pangu_http.cpp +++ b/plugin/business/pangu-http/src/pangu_http.cpp @@ -1002,6 +1002,7 @@ static void http_redirect(const struct tfe_http_session * session, enum tfe_http response = tfe_http_session_response_create(to_write, resp_code); tfe_http_std_field_write(response, TFE_HTTP_LOCATION, url); + tfe_http_std_field_write(response, TFE_HTTP_CONT_LENGTH, "0"); tfe_http_half_append_body(response, NULL, 0, 0); tfe_http_session_response_set(to_write, response); diff --git a/plugin/protocol/http/src/http_half.cpp b/plugin/protocol/http/src/http_half.cpp index f37314e..29048da 100644 --- a/plugin/protocol/http/src/http_half.cpp +++ b/plugin/protocol/http/src/http_half.cpp @@ -1090,7 +1090,7 @@ void hf_private_construct(struct http_half_private * hf_private) hf_content_compress_write(hf_private->cv_compress_object, NULL, 0, hf_private->evbuf_body, 1); } - if (hf_private->content_encoding != HTTP_ACCEPT_ENCODING_NONE) + if (hf_private->evbuf_body && hf_private->content_encoding != HTTP_ACCEPT_ENCODING_NONE) { 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};