summaryrefslogtreecommitdiff
path: root/plugin/protocol/http/src
diff options
context:
space:
mode:
authorluqiuwen <[email protected]>2019-01-10 15:48:22 +0600
committerluqiuwen <[email protected]>2019-01-10 15:48:22 +0600
commitf01fd2adc7dd7773de8db183791cffb5fe11e1fb (patch)
tree9119f3a4bfc238aa5133ede7289620fa5aaf7aa4 /plugin/protocol/http/src
parentd986d8a8cc5951fb355395813bc0a3e1cac93a43 (diff)
Close #109 修正302重定向在Firefox浏览器下跳转缓慢的问题
* Firefox要求302应答体必须包含Content-Length,否则无法正确处理消息体 * 增加302应答的Content-Length字段,填为0.
Diffstat (limited to 'plugin/protocol/http/src')
-rw-r--r--plugin/protocol/http/src/http_half.cpp2
1 files changed, 1 insertions, 1 deletions
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};