Skip to content

Commit

Permalink
Use DOWNSTREAM_REMOTE_ADDRESS_WITHOUT_PORT instead of request header
Browse files Browse the repository at this point in the history
  • Loading branch information
roivaz committed Apr 28, 2023
1 parent 0d5d982 commit 13b01b3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/resource_builders/envoyconfig/resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func TestNew(t *testing.T) {
authority: '%REQ(:AUTHORITY)%'
bytes_received: '%BYTES_RECEIVED%'
bytes_sent: '%BYTES_SENT%'
client_ip: '%REQ(X-ENVOY-EXTERNAL-ADDRESS)%'
client_ip: '%DOWNSTREAM_REMOTE_ADDRESS_WITHOUT_PORT%'
downstream_tls_cipher: '%DOWNSTREAM_TLS_CIPHER%'
downstream_tls_version: '%DOWNSTREAM_TLS_VERSION%'
duration: '%DURATION%'
Expand Down
2 changes: 1 addition & 1 deletion pkg/resource_builders/envoyconfig/templates/listeners.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ func AccessLogConfig_v1(name string, tls bool) []*envoy_config_accesslog_v3.Acce
"upstream_cluster": structpb.NewStringValue("%UPSTREAM_CLUSTER%"),
"upstream_service_time": structpb.NewStringValue("%RESP(X-ENVOY-UPSTREAM-SERVICE-TIME)%"),
"user_agent": structpb.NewStringValue("%REQ(USER-AGENT)%"),
"client_ip": structpb.NewStringValue("%REQ(X-ENVOY-EXTERNAL-ADDRESS)%"),
"client_ip": structpb.NewStringValue("%DOWNSTREAM_REMOTE_ADDRESS_WITHOUT_PORT%"),
}
if tls {
m["downstream_tls_cipher"] = structpb.NewStringValue("%DOWNSTREAM_TLS_CIPHER%")
Expand Down
4 changes: 2 additions & 2 deletions pkg/resource_builders/envoyconfig/templates/listeners_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func TestListenerHTTP_v1(t *testing.T) {
authority: '%REQ(:AUTHORITY)%'
bytes_received: '%BYTES_RECEIVED%'
bytes_sent: '%BYTES_SENT%'
client_ip: '%REQ(X-ENVOY-EXTERNAL-ADDRESS)%'
client_ip: '%DOWNSTREAM_REMOTE_ADDRESS_WITHOUT_PORT%'
downstream_tls_cipher: '%DOWNSTREAM_TLS_CIPHER%'
downstream_tls_version: '%DOWNSTREAM_TLS_VERSION%'
duration: '%DURATION%'
Expand Down Expand Up @@ -170,7 +170,7 @@ func TestListenerHTTP_v1(t *testing.T) {
authority: '%REQ(:AUTHORITY)%'
bytes_received: '%BYTES_RECEIVED%'
bytes_sent: '%BYTES_SENT%'
client_ip: '%REQ(X-ENVOY-EXTERNAL-ADDRESS)%'
client_ip: '%DOWNSTREAM_REMOTE_ADDRESS_WITHOUT_PORT%'
duration: '%DURATION%'
listener: test
method: '%REQ(:METHOD)%'
Expand Down

0 comments on commit 13b01b3

Please sign in to comment.