-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
New Feature - Add custom HTTP Header #313
Comments
I've started implementing this and will create a pull request soon. |
@FelixBoers thank you so much for this contribution! Really nice to get some help 😄 Will close the issue now I merged the PR! |
I'm wondering if this is possible programmatically? I need to be able to pass user id and I was thinking maybe I could plug it somewhere within Ocelot's pipeline to add name from Principle to the header before passing it downstream. |
@SimantoR I'm not exactly sure if I understand you right but I think this will get you there: https://ocelot.readthedocs.io/en/latest/features/delegatinghandlers.html So I would suggest to write a DelegatingHandler which manipulates the downstream request and then calls the base handler. As far as I know there is no direct way for achieving this functionality. |
It should be possible to configure custom HTTP header with static values (without transformation!) for both the downstream response and the upstream request. Currently it's only possible to set them for the downstream response (see #280).
Sample configuration:
If the header is sent in the origin request then it gets overwritten.
Related to #280
Checklist
The text was updated successfully, but these errors were encountered: