envoyproxy/envoy

HPE_INVALID_URL with non-urlencoded args

Open

#12,073 opened on Jul 14, 2020

View on GitHub
 (6 comments) (2 reactions) (0 assignees)C++ (5,373 forks)batch import
area/httphelp wanted

Repository metrics

Stars
 (27,997 stars)
PR merge metrics
 (Avg merge 8d) (378 merged PRs in 30d)

Description

I have an envoy as a http1.1 proxy with default config and when I try to access some non-unicode nonencoded params in uri - I have error 400 with HPE_INVALID_URL in debug log without any information. normalize_path is off by default and there is not a path - it is query string, so this behaviour looks strange.

Repro steps:

  listeners:
  - name: local_listener
    address:
      socket_address:
        protocol: TCP
        address: ::1
        port_value: 12701
    drain_type: MODIFY_ONLY
    traffic_direction: OUTBOUND
    filter_chains:
      - filters:
        - name: envoy.http_connection_manager
          typed_config:
            "@type": type.googleapis.com/envoy.config.filter.network.http_connection_manager.v2.HttpConnectionManager
            stat_prefix: local_balancer
            normalize_path: false
            route_config:
              name: local_balancer_route
              request_headers_to_add:
                - header:
                    key: "X-Local-Proxy"
                    value: "%HOSTNAME%"
              virtual_hosts:
                - name: localhost
                  domains: ["localhost:12701"]
                  routes:
                    - match: { prefix: "/" }
                       route:
                        cluster: example_cluster
                        timeout: 600s
                        retry_policy:
                          retry_on: gateway-error
                          num_retries: 5

cluster config omitted - default 80 port.

Request: curl 'http://localhost:12701/test?arg=Юникодные символы'

Expect: Correct proxy pass to backend Answer: 400 Bad Request

Contributor guide