Nancy icon indicating copy to clipboard operation
Nancy copied to clipboard

CancellationToken never changes in Nancy.Hosting.Self on Canceled Browser Request

Open gerardcarbo opened this issue 7 years ago • 1 comments

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 DEBUG and RELEASE mode
  • [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

gerardcarbo avatar Oct 11 '18 10:10 gerardcarbo

BTW, what's new in the version 1.4.5 ? I cant find any release notes on it.

yar1k0v avatar Feb 11 '19 15:02 yar1k0v