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

Check whether the call into UseHttpCacheHeaders is situated between UseRouting and UseEndpoints #101

Closed
KevinDockx opened this issue Oct 19, 2021 · 5 comments
Assignees
Milestone

Comments

@KevinDockx
Copy link
Owner

Check whether the call into UseHttpCacheHeaders is situated between UseRouting and UseEndpoints - allows for throwing a nice Exception to inform users of this.

Cfr: https://github.com/dotnet/aspnetcore/blob/main/src/Http/Routing/src/Builder/EndpointRoutingApplicationBuilderExtensions.cs#L135

@KevinDockx KevinDockx added this to the 6.0 milestone Oct 19, 2021
@KevinDockx KevinDockx self-assigned this Oct 19, 2021
@KevinDockx
Copy link
Owner Author

RoutingMarkerService is internal - cannot use this to check. Consider ASP.NET Core feature request.

https://github.com/dotnet/aspnetcore/blob/main/src/Http/Routing/src/Builder/EndpointRoutingApplicationBuilderExtensions.cs#L122

@KevinDockx
Copy link
Owner Author

Feature request: dotnet/aspnetcore#37679

@KevinDockx
Copy link
Owner Author

As per Javier's answer on the feature request: for now, use the alternative and check if we can resolve a publicly exposed type, like EndpointDataSource.

In the future, consider an analyzer.

@KevinDockx
Copy link
Owner Author

#102

@KevinDockx
Copy link
Owner Author

Answer isn't sufficient: checking the registered type only checks whether a service is registered on a container, NOT the order in which middleware is added to the request pipeline...

  • leave in the check for the required services for stability reasons in v6
  • think about analyzer approach for vNext

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

No branches or pull requests

1 participant