AsyncHttpClient/async-http-client — pull request #205 by trask (2013-01-19 08:36:38+00:00)
Title: Allow Netty provider subclass to modify pipeline

As part of a unit test, I want to verify that an http response was gzipped, however Netty's HttpContentDecoder removes the Content-Encoding header during decompression, which makes sense, but is thwarting my attempt to verify whether the response was indeed gzipped.

To work around this, I'd like to insert a ChannelHandler in the Netty pipeline before the "inflater" ChannelHandler, e.g.

pipeline.addBefore("inflater", "gzipDetection", new GzipDetectionHandler());

so I can copy the original Content-Encoding header over to another http header before the HttpContentDecoder clears that header.

I mocked up a change to NettyAsyncHttpProvider to expose enough so the Netty pipeline can be modified, and included a unit test to show an example of how this could be used.

I'm curious if this is something you would consider.