Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RequestCanceledMiddleware cannot work when url use 0.0.0.0 #507

Closed
zxbeltm opened this issue Sep 1, 2022 · 3 comments
Closed

RequestCanceledMiddleware cannot work when url use 0.0.0.0 #507

zxbeltm opened this issue Sep 1, 2022 · 3 comments
Labels
bug Issues describing a bug or pull requests fixing a bug.

Comments

@zxbeltm
Copy link

zxbeltm commented Sep 1, 2022

Describe the bug

When I Set asp.net core's applicationUrl to 'http://0.0.0.0:8080', the RequestCanceledMiddleware not work.
But it is working well in 'http://127.0.0.1:8080' or 'http://localhost:8080'

real ip
localhost
127IP

Steps to reproduce

"profiles": {
    "LTM.Module.CCM.TiehejiService01": {
      "commandName": "Project",
      "dotnetRunMessages": true,
      "launchBrowser": true,
      "launchUrl": "weatherforecast",
      "applicationUrl": "http://0.0.0.0:5074",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    },
app.UseHttpException();
app.UseRequestCanceled();

Expected behaviour

none

@zxbeltm zxbeltm added the bug Issues describing a bug or pull requests fixing a bug. label Sep 1, 2022
@RehanSaeed
Copy link
Member

The middleware (code below) doesn't do anything with the host part of the URL. It only looks for OperationCanceledException and HttpContext.RequestAborted.IsCancellationRequested.

https://github.com/Dotnet-Boxed/Framework/blob/main/Source/Boxed.AspNetCore/Middleware/RequestCanceledMiddleware.cs

@zxbeltm
Copy link
Author

zxbeltm commented Sep 2, 2022

The middleware (code below) doesn't do anything with the host part of the URL. It only looks for OperationCanceledException and HttpContext.RequestAborted.IsCancellationRequested.

https://github.com/Dotnet-Boxed/Framework/blob/main/Source/Boxed.AspNetCore/Middleware/RequestCanceledMiddleware.cs

Thanks.By the way,do you know why token.ThrowIfCancellationRequested(); can not throw exception when i changed the url to "http://0.0.0.0:5074" and cancel the request in edge?

@RehanSaeed
Copy link
Member

Sorry, I'm not sure. What error do you get? That might be a question to ask in the ASP.NET repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues describing a bug or pull requests fixing a bug.
Projects
None yet
Development

No branches or pull requests

2 participants