Skip to content

Commit

Permalink
Added new Fix's Application.Run signature
Browse files Browse the repository at this point in the history
  • Loading branch information
markrendle committed Sep 29, 2013
1 parent f590f92 commit 021ce04
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions packaging/nuspec/Simple.Web.nuspec
Expand Up @@ -16,6 +16,7 @@
<files>
<file src="..\..\build\Simple.Web.dll" target="lib\net40" />
<file src="..\..\build\Simple.Web.*db" target="lib\net40" />
<file src="..\..\build\Simple.Web.xml" target="lib\net40" />
<file src="..\..\src\Simple.Web\**\*.cs" target="src" />
</files>
</package>
14 changes: 14 additions & 0 deletions src/Simple.Web/Application.cs
Expand Up @@ -54,6 +54,20 @@ public static Task Run(IDictionary<string, object> env)
.ContinueWith(t => WriteResponse(t, context, env)).Unwrap();
}

public static Task Run(IDictionary<string, object> env, Func<Task> next)
{
var context = new OwinContext(env);
var task = Run(context);

if (task == null)
{
return next();
}

return task
.ContinueWith(t => WriteResponse(t, context, env)).Unwrap();
}

private static Func<Stream, Task> ErrorHandler(string message)
{
return stream =>
Expand Down

0 comments on commit 021ce04

Please sign in to comment.