Remove double slashes from requests

Problem: double slashes in a request can cause the request not to resolve

Any request that contains a two (or more) consecutive slashes can result in a 404 error. For example /hello//world/. The problem in this example is the "//" between hello and world.

Solution: filter for double slashes

Apply a configuration to your Istio ingress to filter for double slashes in requests and replace them.

  1. Create a new configuration file named apigee-merge-slash-filter.yaml.
  2. Paste the following content into the file:
    apiVersion: networking.istio.io/v1alpha3 kind: EnvoyFilter metadata: name: apigee-merge-slashes namespace: istio-system spec: workloadSelector: labels: app: istio-ingressgateway configPatches: - applyTo: NETWORK_FILTER # http connection manager is a filter in Envoy match: context: GATEWAY listener: filterChain: filter: name: "envoy.http_connection_manager" patch: operation: MERGE value: typed_config: "@type": "type.googleapis.com/envoy.config.filter.network.http_connection_manager.v2.HttpConnectionManager" merge_slashes: true
  3. Apply the configuration with the following command:
    kubectl apply -f apigee-merge-slash-filter.yaml