This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* A JSON gzip compression filter, which could easily be adapted to any pattern needed. This uses a custom AfterFilter | |
| * type which is just a fancy wrapper of Action<NancyContext>. It's useful for convention based loading of filters | |
| */ | |
| public class GzipCompressionFilter : AfterFilter | |
| { | |
| protected override void Handle(NancyContext ctx) | |
| { | |
| if ((ctx.Response.ContentType == "application/json") && ctx.Request.Headers.AcceptEncoding.Any( |