-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
feature request: add header only if not already set #3804
Labels
feature ⚙️
New feature or request
Milestone
Comments
gilbsgilbs
added a commit
to gilbsgilbs/caddy
that referenced
this issue
Oct 18, 2020
gilbsgilbs
added a commit
to gilbsgilbs/caddy
that referenced
this issue
Oct 18, 2020
gilbsgilbs
added a commit
to gilbsgilbs/caddy
that referenced
this issue
Oct 18, 2020
gilbsgilbs
added a commit
to gilbsgilbs/caddy
that referenced
this issue
Oct 19, 2020
gilbsgilbs
added a commit
to gilbsgilbs/caddy
that referenced
this issue
Oct 19, 2020
gilbsgilbs
added a commit
to gilbsgilbs/caddy
that referenced
this issue
Oct 19, 2020
gilbsgilbs
added a commit
to gilbsgilbs/caddy
that referenced
this issue
Nov 17, 2020
gilbsgilbs
added a commit
to gilbsgilbs/caddy
that referenced
this issue
Nov 17, 2020
mholt
added a commit
that referenced
this issue
Nov 20, 2020
* implement default values for header directive closes #3804 * remove `set_default` header op and rely on "require" handler instead This has the following advantages over the previous attempt: - It does not introduce a new operation for headers, but rather nicely extends over an existing feature in the header handler. - It removes the need to specify the header as "deferred" because it is already implicitely deferred by the use of the require handler. This should be less confusing to the user. * add integration test for header directive in caddyfile * bubble up errors when parsing caddyfile header directive * don't export unnecessarily and don't canonicalize headers unnecessarily * fix response headers not passed in blocks * caddyfile: fix clash when using default header in block Each header is now set in a separate handler so that it doesn't clash with other headers set/added/deleted in the same block. * caddyhttp: New idle_timeout default of 5m * reverseproxy: fix random hangs on http/2 requests with server push (#3875) see golang/go#42534 * Refactor and cleanup with improvements * More specific link Co-authored-by: Matthew Holt <mholt@users.noreply.github.com> Co-authored-by: Денис Телюх <telyukh.denis@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm in a case where I'd like the header directive to set the header only if it wasn't already set by an upstream server. Think it as a default value for headers. This would be useful for e.g. setting
Cache-Control
tono-store
by default, except if the upstream server defines a specificCache-Control
value. I don't think it is possible yet (at least with the Caddyfile adapter).The syntax could be inspired from the syntax used to append/delete headers:
or alternatively using an explicit parameter (but that wouldn't make much sense when used in combination with +/- IMHO):
Would you accept such contribution? Or is it out of scope?
The text was updated successfully, but these errors were encountered: