Nancy
Nancy copied to clipboard
CancellationToken never changes in Nancy.Hosting.Self on Canceled Browser Request
Prerequisites
- [x] I have written a descriptive issue title
- [x] I have verified that I am running the latest version of Nancy
- [x] I have verified if the problem exist in both
DEBUGandRELEASEmode - [x] I have searched open and closed issues to ensure it has not already been reported
Description
After a request is canceled in the browser, using Asynch Route Handling and Nancy.Hosting.Self, the provided CancellationToken never changes, and CancellationToken.IsCancellationRequested is always false.
Steps to Reproduce
This code never breaks when 'someRequest' is canceled in the browser:
Get["/someRequest/", true] = async (p, ct) => {
await Task.Run(() =>
{
while(true){
Thread.Sleep(100); //do work
if(ct.IsCancellationRequested){
break;
}
}
}
};
System Configuration
Windows 10 x64, Visual Studio Comunity 2017, .Net Framework 4.6.1
- Nancy version: 1.4.5
- Nancy host
- [ ] Nancy.Hosting.Aspnet
- [x] Nancy.Hosting.Self
- [ ] Nancy.Owin ()
- [ ] Other:
- Other Nancy packages and versions: Nancy.Hosting.Self 1.4.1
- .NET Framework version: 4.6.1
BTW, what's new in the version 1.4.5 ? I cant find any release notes on it.