question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Global UpstreamHeaderTransform settings in GlobalConfiguration section

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created 4 months ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
marklonquistcommented, May 26, 2023

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).

1reaction
marklonquistcommented, May 26, 2023

Added a PR

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configuration — Ocelot 1.0.0 documentation
The Global configuration is a bit hacky and allows overrides of Route specific settings. It's useful if you don't want to manage lots...
Read more >
Ocelot Documentation
a GlobalConfiguration. The Routes are the objects that tell Ocelot how to treat an upstream request. The Global configuration is a bit hacky ......
Read more >
Can common config be written in "GlobalConfiguration"
The documentation states: The Global configuration is a bit hacky and allows overrides of Route specific settings.
Read more >
Playing around with headers in Ocelot - danpatrascu.com -
We can choose to add custom headers to all requests, we can specify only certain re-routes that should have headers, we can take...
Read more >
Designing and implementing API Gateways with Ocelot in . ...
The Global configuration allows overrides of ReRoute specific settings. It's useful if you don't want to manage lots of ReRoute specific ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found