-
Notifications
You must be signed in to change notification settings - Fork 335
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(gateway): be more lenient with prefix paths trailing slashes (#5299)
* fix(gateway): be more lenient with prefix paths trailing slashes * test(e2e): add MeshGateway prefix with trailing slash * test: remove validation error Signed-off-by: Mike Beaumont <mjboamail@gmail.com>
- Loading branch information
1 parent
8cacffb
commit 1477105
Showing
6 changed files
with
553 additions
and
78 deletions.
There are no files selected for viewing
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
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
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
172 changes: 172 additions & 0 deletions
172
pkg/plugins/runtime/gateway/testdata/http/rewrite-prefix-trailing-gateway-route.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,172 @@ | ||
Clusters: | ||
Resources: | ||
echo-service-9f149ed9e14091ca: | ||
circuitBreakers: | ||
thresholds: | ||
- maxConnections: 1024 | ||
maxPendingRequests: 1024 | ||
maxRequests: 1024 | ||
maxRetries: 3 | ||
connectTimeout: 5s | ||
edsClusterConfig: | ||
edsConfig: | ||
ads: {} | ||
resourceApiVersion: V3 | ||
name: echo-service-9f149ed9e14091ca | ||
outlierDetection: | ||
enforcingConsecutive5xx: 0 | ||
enforcingConsecutiveGatewayFailure: 0 | ||
enforcingConsecutiveLocalOriginFailure: 0 | ||
enforcingFailurePercentage: 0 | ||
enforcingSuccessRate: 0 | ||
perConnectionBufferLimitBytes: 32768 | ||
type: EDS | ||
typedExtensionProtocolOptions: | ||
envoy.extensions.upstreams.http.v3.HttpProtocolOptions: | ||
'@type': type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions | ||
commonHttpProtocolOptions: | ||
idleTimeout: 3600s | ||
explicitHttpConfig: | ||
httpProtocolOptions: {} | ||
Endpoints: | ||
Resources: | ||
echo-service-9f149ed9e14091ca: | ||
clusterName: echo-service-9f149ed9e14091ca | ||
endpoints: | ||
- lbEndpoints: | ||
- endpoint: | ||
address: | ||
socketAddress: | ||
address: 192.168.1.6 | ||
portValue: 20006 | ||
loadBalancingWeight: 1 | ||
metadata: | ||
filterMetadata: | ||
envoy.lb: | ||
kuma.io/protocol: http | ||
envoy.transport_socket_match: | ||
kuma.io/protocol: http | ||
Listeners: | ||
Resources: | ||
edge-gateway:HTTP:8080: | ||
address: | ||
socketAddress: | ||
address: 192.168.1.1 | ||
portValue: 8080 | ||
enableReusePort: true | ||
filterChains: | ||
- filters: | ||
- name: envoy.filters.network.http_connection_manager | ||
typedConfig: | ||
'@type': type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager | ||
commonHttpProtocolOptions: | ||
headersWithUnderscoresAction: REJECT_REQUEST | ||
idleTimeout: 300s | ||
http2ProtocolOptions: | ||
allowConnect: true | ||
initialConnectionWindowSize: 1048576 | ||
initialStreamWindowSize: 65536 | ||
maxConcurrentStreams: 100 | ||
httpFilters: | ||
- name: envoy.filters.http.local_ratelimit | ||
typedConfig: | ||
'@type': type.googleapis.com/envoy.extensions.filters.http.local_ratelimit.v3.LocalRateLimit | ||
statPrefix: rate_limit | ||
- name: gzip-compress | ||
typedConfig: | ||
'@type': type.googleapis.com/envoy.extensions.filters.http.compressor.v3.Compressor | ||
compressorLibrary: | ||
name: gzip | ||
typedConfig: | ||
'@type': type.googleapis.com/envoy.extensions.compression.gzip.compressor.v3.Gzip | ||
responseDirectionConfig: | ||
disableOnEtagHeader: true | ||
- name: envoy.filters.http.router | ||
typedConfig: | ||
'@type': type.googleapis.com/envoy.extensions.filters.http.router.v3.Router | ||
mergeSlashes: true | ||
normalizePath: true | ||
pathWithEscapedSlashesAction: UNESCAPE_AND_REDIRECT | ||
rds: | ||
configSource: | ||
ads: {} | ||
resourceApiVersion: V3 | ||
routeConfigName: edge-gateway:HTTP:8080 | ||
requestHeadersTimeout: 0.500s | ||
serverName: Kuma Gateway | ||
statPrefix: gateway-default | ||
streamIdleTimeout: 5s | ||
stripAnyHostPort: true | ||
useRemoteAddress: true | ||
listenerFilters: | ||
- name: envoy.filters.listener.tls_inspector | ||
typedConfig: | ||
'@type': type.googleapis.com/envoy.extensions.filters.listener.tls_inspector.v3.TlsInspector | ||
name: edge-gateway:HTTP:8080 | ||
perConnectionBufferLimitBytes: 32768 | ||
trafficDirection: INBOUND | ||
Routes: | ||
Resources: | ||
edge-gateway:HTTP:8080: | ||
name: edge-gateway:HTTP:8080 | ||
requestHeadersToRemove: | ||
- x-kuma-tags | ||
validateClusters: false | ||
virtualHosts: | ||
- domains: | ||
- echo.example.com | ||
name: echo.example.com | ||
routes: | ||
- match: | ||
path: /prefix/a | ||
route: | ||
regexRewrite: | ||
pattern: | ||
googleRe2: {} | ||
regex: .* | ||
substitution: /a | ||
retryPolicy: | ||
numRetries: 5 | ||
perTryTimeout: 16s | ||
retryBackOff: | ||
baseInterval: 0.025s | ||
maxInterval: 0.250s | ||
retryOn: gateway-error,connect-failure,refused-stream | ||
timeout: 15s | ||
weightedClusters: | ||
clusters: | ||
- name: echo-service-9f149ed9e14091ca | ||
requestHeadersToAdd: | ||
- header: | ||
key: x-kuma-tags | ||
value: '&kuma.io/service=gateway-default&' | ||
weight: 1 | ||
totalWeight: 1 | ||
- match: | ||
prefix: /prefix/a/ | ||
route: | ||
prefixRewrite: /a/ | ||
retryPolicy: | ||
numRetries: 5 | ||
perTryTimeout: 16s | ||
retryBackOff: | ||
baseInterval: 0.025s | ||
maxInterval: 0.250s | ||
retryOn: gateway-error,connect-failure,refused-stream | ||
timeout: 15s | ||
weightedClusters: | ||
clusters: | ||
- name: echo-service-9f149ed9e14091ca | ||
requestHeadersToAdd: | ||
- header: | ||
key: x-kuma-tags | ||
value: '&kuma.io/service=gateway-default&' | ||
weight: 1 | ||
totalWeight: 1 | ||
Runtimes: | ||
Resources: | ||
gateway.listeners: | ||
layer: {} | ||
name: gateway.listeners | ||
Secrets: | ||
Resources: {} |
Oops, something went wrong.