Skip to content

Does Ocelot support conditional routing based on a header? #1998

Answered by raman-m
usama-azakaw asked this question in Q&A
Discussion options

You must be logged in to vote

You want to detect Auth header but don't want to authenticate, right?
To achieve that you could use any middleware and class which have local HttpContext or HttpRequest object, mostly all classes and services where you can read Headers collection 👉

After the header detection just fail the request by status code overriding, so use some code from range 3xx-4xx.

Hope it helps!

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by raman-m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
Routing Ocelot feature: Routing
2 participants
Converted from issue

This discussion was converted from issue #1022 on March 17, 2024 13:00.