# File lib/mongrel/handlers.rb, line 287 287: def process(request, response) 288: accepts = request.params[HTTP_ACCEPT_ENCODING] 289: # only process if they support compression 290: if @always_deflate or (accepts and (accepts.include? "deflate" and not response.body_sent)) 291: response.header["Content-Encoding"] = "deflate" 292: # we can't just rewind the body and gzip it since the body could be an attached file 293: response.body.rewind 294: gzout = StringIO.new(Zlib::Deflate.deflate(response.body.read)) 295: gzout.rewind 296: response.body.close 297: response.body = gzout 298: end 299: end