Skip to content
This repository has been archived by the owner on Dec 8, 2018. It is now read-only.

Cannot configure multiple paths over same custom port #514

Closed
herrirya opened this issue Oct 26, 2018 · 2 comments
Closed

Cannot configure multiple paths over same custom port #514

herrirya opened this issue Oct 26, 2018 · 2 comments
Assignees
Milestone

Comments

@herrirya
Copy link

It appears it is not possible to have multiple paths that use the same custom port number (which is likely unintentional). For example:

app.UseHealthChecks("/health/live", port: 9999);
app.UseHealthChecks("/health/ready", port: 9999);

The second configured path in the example ("/health/ready") is not accessible because the first configured path is hogging up the port - seemingly due to the equality condition set up in HealthCheckApplicationBuilderExtensions.cs UseHealthChecksCore() method, line 214.

app.MapWhen(
  c => c.Connection.LocalPort == port,
  b0 => b0.Map(path, b1 => b1.UseMiddleware<HealthCheckMiddleware>(args)));

This middleware is great; thank you for your work.

@rynowak
Copy link
Member

rynowak commented Oct 27, 2018

Thanks. This looks like this is indeed a bug.

@rynowak rynowak added this to the 2.2.0 milestone Oct 27, 2018
@rynowak rynowak self-assigned this Oct 27, 2018
rynowak added a commit that referenced this issue Oct 28, 2018
Fixes #511 and #514

It's really confusing to people that we use Map. Users expect that the
URL they provide for the health check middleware will only process
exact matches. The way it behaves when using map is not optimal for some
of the common patterns.
rynowak added a commit that referenced this issue Oct 28, 2018
Fixes #511 and #514

It's really confusing to people that we use Map. Users expect that the
URL they provide for the health check middleware will only process
exact matches. The way it behaves when using map is not optimal for some
of the common patterns.
@rynowak rynowak mentioned this issue Oct 28, 2018
rynowak added a commit that referenced this issue Oct 28, 2018
Fixes #511 and #514

It's really confusing to people that we use Map. Users expect that the
URL they provide for the health check middleware will only process
exact matches. The way it behaves when using map is not optimal for some
of the common patterns.
@rynowak
Copy link
Member

rynowak commented Oct 28, 2018

Fixed for the 2.2.0 release. Thanks for the feedback 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants