-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
refactor(meta) add meta._SERVER_TOKENS #3511
Conversation
63320c1
to
242266d
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.
It seems like we should be merging this first, before the delayed response fixes. Then, delayed response PRs can each have two commits:
- Handle delayed responses
- Add server tokens + tests if necessary
kong/plugins/aws-lambda/handler.lua
Outdated
@@ -150,6 +153,10 @@ function AWSLambdaHandler:access(conf) | |||
ngx.status = res.status | |||
end | |||
|
|||
if singletons.configuration.enabled_headers[constants.HEADERS.VIA] then | |||
ngx.header["Via"] = meta._SERVER_TOKENS |
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.
We should also test this (or make it part of a separate commit)
kong/tools/responses.lua
Outdated
|
||
else | ||
ngx.header["Server"] = server_header | ||
end |
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.
Ditto: probably belong to a separate commit (i.e. in the PR already opened for delayed response)
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.
I think you wanted to comment about request-termination plugin changes here? I will make separate PR for the two plugins.
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.
I think @thibaultcha really meant a separate commit here, because the rest of the PR is all about internal reorganization of the meta._SERVER_TOKENS
but this bit is something else, as it changes the behavior of the Server
header sent (and would probably merit a separate test checking the header behavior).
0d907ca
to
e9f49d7
Compare
e9f49d7
to
6bee557
Compare
spec/01-unit/009-responses_spec.lua
Outdated
@@ -192,4 +192,33 @@ describe("Response helpers", function() | |||
assert.spy(s).was.called_with(ngx.ctx) | |||
end) | |||
end) | |||
|
|||
describe("server tokens", function() | |||
it("are send by default", function() |
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.
typo: are sent by default
(likewise below)
I guess the first commit should be |
350659e
to
bd0b403
Compare
bd0b403
to
4b36842
Compare
|
Summary
Add
kong.meta._SERVER_TOKENS
and change codebase to use that everywhere.