Skip to content

Incorrect url rewrite, double slash #3807

@Demacr

Description

@Demacr

Description:
I have HTTPRoute with following configuration:

      filters:
        - type: URLRewrite
          urlRewrite:
            path:
              replacePrefixMatch: /api/service/
              type: ReplacePrefixMatch
      matches:
        - path:
            type: PathPrefix
            value: /service/

I expect getting /api/service/version rewrite for /service/version request but got /api/service//version.

Environment:
version: v1.0.2

Logs:

envoy-dev-eg-527a6325-856695c98-xbrgh envoy {"start_time":"2024-07-10T14:28:24.951Z","method":"GET","x-envoy-origin-path":"/api/service//version","protocol":"HTTP/1.1","response_code":"400","response_flags":"-","response_code_details":"via_upstream","connection_termination_details":"-","upstream_transport_failure_reason"
:"-","bytes_received":"0","bytes_sent":"435","duration":"2","x-envoy-upstream-service-time":"-","x-forwarded-for":"XXXX,","user-agent":"XXX","x-request-id":"77f300c3-be96-4ebf-87de-f6d135bc19e
c",":authority":"HOST","upstream_host":"172.20.0.50:8080","upstream_cluster":"httproute/dev/service/rule/0","upstream_local_address":"172.20.1.22:59174","downstream_local_address":"172.20.1.22:8080","downstream_remote_address":"XXXX:44076","requested_server_name":"-","route_name":"http
route/dev/service/rule/0/match/0/XXXX"}

P.S. Also, found close issue #2976 but for Redirect

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions