-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added WithCancellationTokenSource method to the IServerBuilder (#262)
- Loading branch information
1 parent
976d95a
commit cee06cc
Showing
6 changed files
with
51 additions
and
43 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
namespace MyTested.WebApi.Tests.Setups | ||
{ | ||
using System.Web.Http; | ||
using Owin; | ||
|
||
public class WebApiStartup | ||
{ | ||
public void Configuration(IAppBuilder app) | ||
{ | ||
app.Use((context, next) => | ||
{ | ||
if (context.Request.CallCancelled.IsCancellationRequested) | ||
{ | ||
context.Response.StatusCode = 500; | ||
context.Response.Write("Canceled"); | ||
} | ||
return next(); | ||
}); | ||
|
||
var config = new HttpConfiguration(); | ||
WebApiConfig.Register(config); | ||
app.UseWebApi(config); | ||
} | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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