Skip to content

Instantly share code, notes, and snippets.

@bjartwolf
Created May 1, 2014 18:28
Show Gist options
  • Save bjartwolf/a5c58e9e9cfee8e40c62 to your computer and use it in GitHub Desktop.
Save bjartwolf/a5c58e9e9cfee8e40c62 to your computer and use it in GitHub Desktop.
contentnegotiation
public async Task Invoke(IDictionary<string, object> env)
{
var ctx = new OwinContext(env);
var accepts = ctx.Request.Accept;
if (accepts != null && accepts == accepts.ToUpper())
{
ctx.Response.Body = new CapsStream(ctx.Response.Body);
}
await next(env);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment