From 75646c0933e21b881c7fb36ff0199fc51cbf65e3 Mon Sep 17 00:00:00 2001 From: Martin Kraemer Date: Wed, 30 Jan 2002 14:56:42 +0000 Subject: [PATCH] Something sets the content_encoding, even if a directory listing is going to be returned. Hack: unset the content_encoding if dirlisting == TRUE. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93106 13f79535-47bb-0310-9956-ffa450edef68 --- modules/proxy/proxy_ftp.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/proxy/proxy_ftp.c b/modules/proxy/proxy_ftp.c index 89a628a678..d18578fb24 100644 --- a/modules/proxy/proxy_ftp.c +++ b/modules/proxy/proxy_ftp.c @@ -1561,7 +1561,14 @@ int ap_proxy_ftp_handler(request_rec *r, proxy_server_conf *conf, ap_log_error(APLOG_MARK, APLOG_DEBUG | APLOG_NOERRNO, 0, r->server, "proxy: FTP: Content-Type set to %s", r->content_type); - /* set content-encoding */ + /* If an encoding has been set by mistake, delete it. + * @@@ FIXME (e.g., for ftp://user@host/file*.tar.gz, + * @@@ the encoding is currently set to x-gzip) + */ + if (dirlisting && r->content_encoding != NULL) + r->content_encoding = NULL; + + /* set content-encoding (not for dir listings, they are uncompressed)*/ if (r->content_encoding != NULL && r->content_encoding[0] != '\0') { ap_log_error(APLOG_MARK, APLOG_DEBUG | APLOG_NOERRNO, 0, r->server, "proxy: FTP: Content-Encoding set to %s", r->content_encoding); -- 2.40.0