GZip/Deflate Decompress the Request Body

May 23, 2009 at 3:55 AM


It's fairly straight forward to GZip/Deflate compress the response data using a HttpModule but I didn't see an easy way to apply GZipStream/DeflateStream (from System.IO.Compression) to the incoming data.

Are there any hooks into HttpServer.DecodeBody that I didn't see that would allow me to preprocess the Stream (decompress it before the rest of the decoding happens) so that the call from HttpServer.HandleRequest's calls to DecodeBody would properly decompress the incoming stream?

I see the various IFormDecoder implementations but it wasn't completely obvious to me how (if possible) I could use an IFormDecoder to accomplish what I'm looking for.

Thank you in advance,