add_header is a giant foot gun
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Nginx |
New
|
Undecided
|
Unassigned |
Bug Description
Side effects are often the cause of bugs. Explicit is better than implicit.
To quote this link:
https:/
> "add" doesn't usually mean "subtract everything else"
The Nginx add_header is very counter intuitive, because it removes all other headers, for example when used in a location block.
Could we please get an `append_header` to add a header without removing the others, and a `clear_headers` if one wishes to reset the headers. This way there is no hidden magic. I do not feel strongly about the proposed solution, but a way in which to keep all headers, and add one more, e.g. a caching strategy to a certain location block, would be great.
This is a request for a new feature from upstream and needs filed at NGINX, not here. The Nginx 'project' here is not the upstream NGINX team.