-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Inheritance control for add_header and add_trailer. #918
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
Conversation
|
✅ All required contributors have signed the F5 CLA for this PR. Thank you! |
|
I have hereby read the F5 CLA and agree to its terms |
Headers filter: ?
s/value/parameter/? also to avoid confusing with header/trailer array "values"
Just for the record, both can be expressed with add_header "" (empty value).
Personally, it may be visually challenging to read text not broken in paragraphs, |
|
The diff technically looks good, though I'd still try to implement this in the existing directives, |
The new directives add_header_inherit and add_trailer_inherit allow to alter inheritance rules for the values specified in the add_header and add_trailer directives in a convenient way. The "merge" parameter enables appending the values from the previous level to the current level values. The "off" parameter cancels inheritance of the values from the previous configuration level, similar to add_header "" (2194e75). The "on" parameter (default) enables the standard inheritance behaviour, which is to inherit values from the previous level only if there are no directives on the current level. The inheritance rules themselves are inherited in a standard way. Thus, for example, "add_header_inherit merge;" specified at the top level will be inherited in all nested levels recursively unless redefined below.
Discussed this in person. My points:
|
Thanks, modified a bit and applied. |
7ffec80 to
3315d28
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome.
New directives
add_header_inheritandadd_trailer_inheritcontrol how headers and trailers are inherited from the previous level.The value
offdisables inheritance. The valueon(default) triggers the previous behavior when the values from the previous level are inherited only if no values are set at the current level. The valuemergeenables merging the values from the previous level into the current level values.The inheritance control modes are themselves inherited in a standard way. Thus
add_header_inherit mergespecified at the top level will enable the merge inheritance mode for all the levels below.Inheritance control for other directives like
proxy_set_headermay follow later.This addresses #591