-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Always set headers with add-headers option #4463
Conversation
Hi @zerda. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
It should work regardless of the response code or add_header directive in location.
/ok-to-test |
Codecov Report
@@ Coverage Diff @@
## master #4463 +/- ##
=========================================
Coverage ? 59.06%
=========================================
Files ? 89
Lines ? 6748
Branches ? 0
=========================================
Hits ? 3986
Misses ? 2334
Partials ? 428 Continue to review full report at Codecov.
|
/retest |
/lgtm |
@zerda thanks! |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aledbf, zerda The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What this PR does / why we need it:
With
nginx-custom-headers
configmap andadd-headers
option.It should set
X-Request-Id
header to response all the time, but failed at following scenarios because of limits withadd_header
directive.From the documentation on add_header
when response code is 40x or 50x.
By default,
add_header
adds the specified field to a response header provided only when the response code equals 200, 201 (1.3.10), 204, 206, 301, 302, 303, 304, 307 (1.1.16, 1.0.13), or 308 (1.13.0).when
add_header
used in location blockThese directives are inherited from the previous level if and only if there are no
add_header
directives defined on the current level.If an ingress has
nginx.ingress.kubernetes.io/auth-url
annotation, it will not setX-Request-Id
to the response, because theadd_header Set-Cookie $auth_cookie;
already exists in location.Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged):fixes #4359
Special notes for your reviewer:
None