diff options
| author | luqiuwen <[email protected]> | 2019-08-22 11:51:09 +0800 |
|---|---|---|
| committer | 陆秋文 <[email protected]> | 2019-08-26 10:12:14 +0800 |
| commit | 3a33de4b7cf71d2f88f1be5f60192d1541396386 (patch) | |
| tree | cd60827ac6d42edd7ef982ffae17528e3080d38b /plugin/protocol/http/src | |
| parent | b689485fea524850f5f0c11bbc21d90ba40e15a6 (diff) | |
修正重复写入Content-Length的问题
Diffstat (limited to 'plugin/protocol/http/src')
| -rw-r--r-- | plugin/protocol/http/src/http_half.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
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 */ |
