Ocelot
Ocelot copied to clipboard
Global UpstreamHeaderTransform settings in GlobalConfiguration section
New Feature
Add UpstreamHeaderTransform globally for all routes.
Motivation for New Feature
Currently we have to set the same transforms on all routes, leaving a lot of copy paste work.
"UpstreamHeaderTransform": {
"X-Forwarded-For": "{RemoteIpAddress}",
"X-Forwarded-Host": "{BaseUrl}",
"X-Forwarded-Proto": "https"
}
A solution would be to also set global transforms in GlobalConfiguration
Related to
Feature: Headers Transformation
Hi Mark!
Thanks for paying your attention to this per Route feature. Yes, I agree, it makes sense to have Headers Transformation on the global level for all routes.
Do you have some preliminary solution? Did you fork the Ocelot repo? So, I have assigned this issue to you because I expect most active communication and collaboration on that feature.
If you've seen someone's solution, just let me know about please!
@abooraja @anktsrkr @binarymash @briansantura @geffzhang @jps @margaale @philproctor @TomPallister Do we accept this new feature?
I do not currently have a solution for it no, but I'd say it would be pretty easy to implement.
Could be a new DefaultUpstreamHeaderTransform
and DefaultDownstreamHeaderTransform
on the GlobalConfiguration
object.
Then, if there is a header transform set on a route which is also a default, that would "win" over the default one (so you can override specific headers on specific routes).
Added a PR
👌 I believe this local-to-global feature enhancement will be useful for the Ocelot community. So, I'm going to accept this feature request... ✔️
The issue has been accepted due to open PR #1659
- #1659
Is it solved? I urgently need this feature
@mingyouzhu commented on Nov 17
Hi 老中医 ! Linked PR #1659 is mostly ready. We need to update docs only and/or polish the code. This feature can be added to Nov'23 release. I'll discuss with the team... Sounds good? Sorry, we don't make "urgent" releases! As an urgent solution you can clone marklonquist forked repo, checkout feature branch and compile it.
Any ETA to release this feature?
@spaduret This PR was added to Annual 2023 release. Watch the progress please! Sorry, it cannot be released so fast as you/community want/s.