-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Labels
proposalAn issue that proposes a feature requestAn issue that proposes a feature request
Description
When using the VirtualServer CRD, If you attempt to set any of the headers that are included by default in the temapltes, you end of with duplicate headers.
This is limited to the subset of headers that are included by default to support http and grpc.
For example:
X-Real-IP
X-Forwarded-For
X-Forwarded-Host
X-Forwarded-Port
X-Forwarded-Proto
For example:
- action:
proxy:
requestHeaders:
set:
- name: X-Forwarded-For
value: ${http_cf_connecting_ip}
- name: X-Forwarded-Proto
value: ${scheme}-foo
Will result in the following:
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For "${http_cf_connecting_ip}";
proxy_set_header X-Forwarded-Proto "${scheme}-foo";
This causes the headers to be sent upstream twice: once with the default value and once with the defined value.
This change prevents the duplication from happening for the included headers and gives precedence to the defined value (over the default).
Metadata
Metadata
Assignees
Labels
proposalAn issue that proposes a feature requestAn issue that proposes a feature request