           (do
             (.write baos (mk-trailer deflater crc))
             (.close baos)
-            (let [channel-buffer (ChannelBuffers/copiedBuffer (.toByteArray baos))]
-              channel-buffer)))))))
+            (ChannelBuffers/copiedBuffer (.toByteArray baos))))))))
 
 (defn- send-chunks
   [deflater downstream buf]
-  (println "GZIPPING CHUNKS")
   (let [buf-len (alength buf)]
     (loop []
       (let [compressed-bytes (.deflate deflater buf 0 buf-len)]
         (if-not (= 0 compressed-bytes)
           (let [channel-buffer (ChannelBuffers/copiedBuffer buf 0 compressed-bytes)]
-            (println "channel buffer: ")
-            (println (ChannelBuffers/hexDump channel-buffer))
             (downstream :body channel-buffer)
             (recur)))))))
 

             (.reset deflater)

             ;; send the resposne with appropriate headers
             (let [content-type (string/trim (first (string/split #";" (or content-type-header ""))))
                   gzip-content-type? (contains? (:gzip-content-types opts) content-type)]
               (if-not (and gzip-content-type? (:accept-gzip? @state))
                 (downstream :response resp)
                 (let [hdrs (assoc hdrs "content-encoding" "gzip")]
                   (swap! state #(assoc % :gzip? true))
                   (if (= :chunked body)
                     (downstream :response [status hdrs body])
                     (downstream :response [status hdrs (gzip-entire-body deflater crc body)]))))))

           (body [chunk]
             (if-not (:gzip? @state)


(defn- gzip-entire-body
  [deflater crc body]
  (let [baos (ByteArrayOutputStream.)
        buf (byte-array 4092)
        bytes (body->byte-array body)]
