From a7cc4e2b3706c17bd64afec121e0b2515aacaf63 Mon Sep 17 00:00:00 2001 From: Reiji Date: Sat, 20 Jan 2018 14:01:37 +0100 Subject: [PATCH] * src/http.c (gethttp): Fix bug that prevented all files from being decompressed Signed-off-by: Darshit Shah --- src/http.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/http.c b/src/http.c index 1cd2768c..5bbaa52c 100644 --- a/src/http.c +++ b/src/http.c @@ -3717,7 +3717,7 @@ gethttp (const struct url *u, struct url *original_url, struct http_stat *hs, /* Make sure the Content-Type is not gzip before decompressing */ if (type) { - const char * p = strchr (type, '/'); + p = strchr (type, '/'); if (p == NULL) { hs->remote_encoding = ENC_GZIP; @@ -3744,8 +3744,9 @@ gethttp (const struct url *u, struct url *original_url, struct http_stat *hs, /* don't uncompress if a file ends with '.gz' or '.tgz' */ if (hs->remote_encoding == ENC_GZIP && (p = strrchr(u->file, '.')) - && (c_strcasecmp(p, ".gz") || c_strcasecmp(p, ".tgz"))) + && (c_strcasecmp(p, ".gz") == 0 || c_strcasecmp(p, ".tgz") == 0)) { + DEBUGP (("Enabling broken server workaround. Will not decompress this GZip file.\n")); hs->remote_encoding = ENC_NONE; } } -- 2.16.0