Skip to content

Commit 7ff6c80

Browse files
committed
docs, test: tidy host normalization for trailing-dot-only scope
- docs: qualify the field reference as spec.headers.host.stripTrailingHostDot (review feedback endorsed by @arkodg) - test: drop the now-redundant third xDS listener; keep one listener enabling stripTrailingHostDot and one control with no host settings Signed-off-by: Salim Boulkour <salim.boulkour@algolia.com>
1 parent 2baa110 commit 7ff6c80

6 files changed

Lines changed: 1 addition & 101 deletions

File tree

internal/xds/translator/testdata/in/xds-ir/host-normalization.yaml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,3 @@ http:
3131
- host: "2.2.2.2"
3232
port: 8082
3333
name: "second-route-dest/backend/0"
34-
- name: "third-listener"
35-
address: "::"
36-
port: 8083
37-
hostnames:
38-
- "*"
39-
routes:
40-
- name: "third-route"
41-
hostname: "*"
42-
destination:
43-
name: "third-route-dest"
44-
settings:
45-
- endpoints:
46-
- host: "3.3.3.3"
47-
port: 8083
48-
name: "third-route-dest/backend/0"
49-
host:
50-
stripTrailingHostDot: true

internal/xds/translator/testdata/out/xds-ir/host-normalization.clusters.yaml

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -44,26 +44,3 @@
4444
name: second-route-dest
4545
perConnectionBufferLimitBytes: 32768
4646
type: EDS
47-
- circuitBreakers:
48-
thresholds:
49-
- maxRetries: 1024
50-
commonLbConfig: {}
51-
connectTimeout: 10s
52-
dnsLookupFamily: V4_PREFERRED
53-
edsClusterConfig:
54-
edsConfig:
55-
ads: {}
56-
resourceApiVersion: V3
57-
serviceName: third-route-dest
58-
ignoreHealthOnHostRemoval: true
59-
loadBalancingPolicy:
60-
policies:
61-
- typedExtensionConfig:
62-
name: envoy.load_balancing_policies.least_request
63-
typedConfig:
64-
'@type': type.googleapis.com/envoy.extensions.load_balancing_policies.least_request.v3.LeastRequest
65-
localityLbConfig:
66-
localityWeightedLbConfig: {}
67-
name: third-route-dest
68-
perConnectionBufferLimitBytes: 32768
69-
type: EDS

internal/xds/translator/testdata/out/xds-ir/host-normalization.endpoints.yaml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,3 @@
2222
loadBalancingWeight: 1
2323
locality:
2424
region: second-route-dest/backend/0
25-
- clusterName: third-route-dest
26-
endpoints:
27-
- lbEndpoints:
28-
- endpoint:
29-
address:
30-
socketAddress:
31-
address: 3.3.3.3
32-
portValue: 8083
33-
loadBalancingWeight: 1
34-
loadBalancingWeight: 1
35-
locality:
36-
region: third-route-dest/backend/0

internal/xds/translator/testdata/out/xds-ir/host-normalization.listeners.yaml

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -65,37 +65,3 @@
6565
maxConnectionsToAcceptPerSocketEvent: 1
6666
name: second-listener
6767
perConnectionBufferLimitBytes: 32768
68-
- address:
69-
socketAddress:
70-
address: '::'
71-
portValue: 8083
72-
defaultFilterChain:
73-
filters:
74-
- name: envoy.filters.network.http_connection_manager
75-
typedConfig:
76-
'@type': type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
77-
commonHttpProtocolOptions:
78-
headersWithUnderscoresAction: REJECT_REQUEST
79-
http2ProtocolOptions:
80-
initialConnectionWindowSize: 1048576
81-
initialStreamWindowSize: 65536
82-
maxConcurrentStreams: 100
83-
httpFilters:
84-
- name: envoy.filters.http.router
85-
typedConfig:
86-
'@type': type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
87-
suppressEnvoyHeaders: true
88-
normalizePath: true
89-
rds:
90-
configSource:
91-
ads: {}
92-
resourceApiVersion: V3
93-
routeConfigName: third-listener
94-
serverHeaderTransformation: PASS_THROUGH
95-
statPrefix: http-8083
96-
stripTrailingHostDot: true
97-
useRemoteAddress: true
98-
name: third-listener
99-
maxConnectionsToAcceptPerSocketEvent: 1
100-
name: third-listener
101-
perConnectionBufferLimitBytes: 32768

internal/xds/translator/testdata/out/xds-ir/host-normalization.routes.yaml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,3 @@
2626
cluster: second-route-dest
2727
upgradeConfigs:
2828
- upgradeType: websocket
29-
- ignorePortInHostMatching: true
30-
name: third-listener
31-
virtualHosts:
32-
- domains:
33-
- '*'
34-
name: third-listener/*
35-
routes:
36-
- match:
37-
prefix: /
38-
name: third-route
39-
route:
40-
cluster: third-route-dest
41-
upgradeConfigs:
42-
- upgradeType: websocket

site/content/en/latest/tasks/traffic/host-header-normalization.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ using the [ClientTrafficPolicy][] API.
1313

1414
Envoy does not strip trailing dots from the `Host` header by default, unlike some
1515
other proxies (e.g. NGINX). This means requests with `Host: example.com.` will not
16-
match routes with domains set to `example.com`. Use `headers.host.stripTrailingHostDot` to
16+
match routes with domains set to `example.com`. Use `spec.headers.host.stripTrailingHostDot` to
1717
normalize these requests.
1818

1919
When the host includes a port (e.g. `example.com.:443`), only the trailing dot from

0 commit comments

Comments
 (0)