-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
feat(core): support inbound and outbound Via header #12733
Merged
hanshuebner
merged 2 commits into
master
from
FTI-5807-paypal-kong-gateway-via-header-is-not-conforming-to-the-rfc-standard
Jul 15, 2024
Merged
feat(core): support inbound and outbound Via header #12733
hanshuebner
merged 2 commits into
master
from
FTI-5807-paypal-kong-gateway-via-header-is-not-conforming-to-the-rfc-standard
Jul 15, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Will add tests to spec/02-integration/05-proxy/03-upstream_headers_spec.lua |
bungle
reviewed
Mar 14, 2024
1e45f29
to
dcbe2db
Compare
bungle
reviewed
Mar 19, 2024
dcbe2db
to
cd54a0e
Compare
chronolaw
reviewed
Mar 29, 2024
986762e
to
12a5655
Compare
chronolaw
approved these changes
Mar 29, 2024
This is for |
This is for |
62e2459
to
85521bf
Compare
Just did a rebase and waiting for CI. |
chobits
reviewed
Jul 3, 2024
chobits
approved these changes
Jul 4, 2024
A couple of comments:
|
bungle
previously requested changes
Jul 4, 2024
chobits
approved these changes
Jul 11, 2024
chobits
reviewed
Jul 11, 2024
chobits
reviewed
Jul 11, 2024
chobits
reviewed
Jul 11, 2024
chobits
reviewed
Jul 11, 2024
chobits
reviewed
Jul 11, 2024
0bade6e
to
308c1c7
Compare
According to [RFC7230](https://datatracker.ietf.org/doc/html/rfc7230#section-5.7.1) and [RFC9110](https://datatracker.ietf.org/doc/html/rfc9110#name-via), Kong gateway MUST append protocol name (optional), protocol version and host (or pseudonym) information when forwarding HTTP messages from clients to upstreams. Currently, Kong just ignores this part. And optionally append the information when forwarding messages in the reverse direction, depending on the `headers` configuration in "kong.conf". Currently, Kong blindly overrides the response `Via` header with server token. This PR do the following work. 1. Append inbound info like `1.1 kong/3.8.0`, and outbound info like `1.1 kong/3.8.0`. 2. Supports gRPC and gRPCs protocols, like inbound `2 kong/3.8.0` and outbound `2 kong/3.8.0`. 3. When the upstream does not include the `Server` header, it inserts one like `kong/3.8.0`. 4. Fix `Via` assignment of `aws-lamdba` and `azure-function` plugins.
a69e7f4
to
c314e90
Compare
chronolaw
reviewed
Jul 11, 2024
Co-authored-by: Chrono <chrono_cpp@me.com>
chobits
approved these changes
Jul 12, 2024
hanshuebner
approved these changes
Jul 15, 2024
Successfully created cherry-pick PR for |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
cherry-pick kong-ee
schedule this PR for cherry-picking to kong/kong-ee
core/proxy
core/templates
plugins/aws-lambda
plugins/azure-functions
size/L
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
According to RFC7230 and RFC9110 gateway MUST append protocol, version and host (or pseudonym) information when forwarding HTTP messages from clients to upstreams. Currently, Kong just ignores this part.
And optionally append the information when forwarding messages in the reverse direction, depending on the
headers
configuration. Currently, Kong blindly overrides the responseVia
header with server token.This PR do the following works:
1.1 kong/3.8.0
, and outbound info like1.1 kong/3.8.0
.2 kong/3.8.0
and outbound2 kong/3.8.0
.Server
header, it inserts one likekong/3.8.0
.Via
assignment ofaws-lamdba
andazure-function
plugins.This is scheduled for
3.8.0
.Checklist
changelog/unreleased/kong
orskip-changelog
label added on PR if changelog is unnecessary. README.mdIssue reference
Fix #FTI-5807