# File lib/mongrel/handlers.rb, line 298
298:     def process(request, response)
299:       accepts = request.params[HTTP_ACCEPT_ENCODING]
300:       # only process if they support compression
301:       if @always_deflate or (accepts and (accepts.include? "deflate" and not response.body_sent))
302:         response.header["Content-Encoding"] = "deflate"
303:         # we can't just rewind the body and gzip it since the body could be an attached file
304:         response.body.rewind
305:         gzout = StringIO.new(Zlib::Deflate.deflate(response.body.read))
306:         gzout.rewind
307:         response.body.close
308:         response.body = gzout
309:       end
310:     end