aboutsummaryrefslogtreecommitdiffstats
path: root/src/rspamd_proxy.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-05-08 17:52:32 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-05-08 17:52:32 +0100
commit81c94076a9c2b9f28ec98092f7574d9fce3da21d (patch)
tree07d2fc55eabbbcd33b65adba239f091cb6208ec8 /src/rspamd_proxy.c
parent4106c09059483cfb2f905e833bdb1fb447dbddbf (diff)
downloadrspamd-81c94076a9c2b9f28ec98092f7574d9fce3da21d.tar.gz
rspamd-81c94076a9c2b9f28ec98092f7574d9fce3da21d.zip
[Minor] Fix compression/decompression
Diffstat (limited to 'src/rspamd_proxy.c')
-rw-r--r--src/rspamd_proxy.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/rspamd_proxy.c b/src/rspamd_proxy.c
index fb782d3eb..71d3ecaab 100644
--- a/src/rspamd_proxy.c
+++ b/src/rspamd_proxy.c
@@ -926,7 +926,7 @@ proxy_request_compress (struct rspamd_http_message *msg)
flags = rspamd_http_message_get_flags (msg);
- if (!rspamd_http_message_find_header (msg, "compression")) {
+ if (!rspamd_http_message_find_header (msg, "Compression")) {
if ((flags & RSPAMD_HTTP_FLAG_SHMEM) ||
!(flags & RSPAMD_HTTP_FLAG_HAS_BODY)) {
/* Cannot compress shared or empty message */
@@ -968,7 +968,7 @@ proxy_request_decompress (struct rspamd_http_message *msg)
ZSTD_inBuffer zin;
ZSTD_outBuffer zout;
- if (rspamd_http_message_find_header (msg, "compression")) {
+ if (rspamd_http_message_find_header (msg, "Compression")) {
in = rspamd_http_message_get_body (msg, &inlen);
if (in == NULL || inlen == 0) {
@@ -1011,6 +1011,7 @@ proxy_request_decompress (struct rspamd_http_message *msg)
}
}
+ body->len = zout.pos;
ZSTD_freeDStream (zstream);
rspamd_http_message_set_body_from_fstring_steal (msg, body);
rspamd_http_message_remove_header (msg, "Compression");