In finish_http_response(), don't add an Content-Encoding header if compression failed.
authorFabian Keil <fk@fabiankeil.de>
Wed, 29 Jun 2011 18:36:49 +0000 (18:36 +0000)
committerFabian Keil <fk@fabiankeil.de>
Wed, 29 Jun 2011 18:36:49 +0000 (18:36 +0000)
cgi.c

diff --git a/cgi.c b/cgi.c
index 71d8a52..02270ca 100644 (file)
--- a/cgi.c
+++ b/cgi.c
@@ -1,4 +1,4 @@
-const char cgi_rcs[] = "$Id: cgi.c,v 1.133 2011/06/25 12:40:27 fabiankeil Exp $";
+const char cgi_rcs[] = "$Id: cgi.c,v 1.134 2011/06/25 12:40:55 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/cgi.c,v $
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/cgi.c,v $
@@ -1588,8 +1588,8 @@ struct http_response *finish_http_response(const struct client_state *csp, struc
       {
          freez(rsp->body);
          rsp->body = compressed_content;
       {
          freez(rsp->body);
          rsp->body = compressed_content;
+         err = enlist_unique_header(rsp->headers, "Content-Encoding", "deflate");
       }
       }
-      err = enlist_unique_header(rsp->headers, "Content-Encoding", "deflate");
    }
 #endif
 
    }
 #endif