Skip to content

Instantly share code, notes, and snippets.

View fxbeckers's full-sized avatar

François-Xavier Beckers fxbeckers

View GitHub Profile
@fxbeckers
fxbeckers / GZipMiddleware.cs
Last active October 17, 2016 04:35
Pretty naive version of an OWIN/Katana middleware gzipping response stream whose length meets fixed requirements.
public sealed class GZipMiddleware {
private readonly Func<IDictionary<string, object>, Task> next;
public GZipMiddleware(Func<IDictionary<string, object>, Task> next) {
this.next = next;
}
public async Task Invoke(IDictionary<string, object> environment) {
var context = new OwinContext(environment);