Skip to content

merge_slashes option moves trailing slash from path to end of the the query string #10912

@feature-id

Description

@feature-id

Hi.

Trying to remove duplicated slashes from URL, so enabled merge_slashes option in http_connection_manager config. Duplicated slashes become single now, but now I'm getting trailing slash moved from the end of the URL path to the end of the query string, which is very unexpected.

For example:
http://example.com//test/?somequery_string becomes http://example.com/test?somequery_string/

However these requests are processing as expected:
http://example.com/test/?somequery_string -> http://example.com/test/?somequery_string
http://example.com//test/foo -> http://example.com/test/foo

When merge_slashes is disabled, everything is kinda as expected too:
http://example.com//test/?somequery_string -> http://example.com//test?somequery_string

Didn't find any related issue, looks like a bug?

Tried on envoy 1.12.2, 1.13.0, 1.14.1
normalize_path option is off

Envoy config:

  - name: listener_0
    address:
      socket_address: { address: 0.0.0.0, port_value: 80 }
    filter_chains:
    - filters:
      - name: envoy.http_connection_manager
        config:
          stat_prefix: ingress_http
          codec_type: AUTO
          common_http_protocol_options:
            idle_timeout: 300s
          use_remote_address: yes
          xff_num_trusted_hops: 1
          merge_slashes: yes
          access_log:
            - name: envoy.file_access_log
              config:
                path: /dev/stdout
          route_config:
            name: local_route
            virtual_hosts:
            - name: example_vhost
              domains: ["example.com"]
              routes:
              - match: { prefix: "/" }
                direct_response:
                    status: "200"

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions