envoyproxy/envoy

scheme field should be case-insensitive for the sake of robustness

Open

#28.594 geöffnet am 25. Juli 2023

Auf GitHub ansehen
 (3 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)C++ (5.373 Forks)batch import
area/httpbughelp wanted

Repository-Metriken

Stars
 (27.997 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 8T) (378 gemergte PRs in 30 T)

Beschreibung

Title: scheme field should be case-insensitive for the sake of robustness

Description:

When redirecting the request for envoyproxy.io to the local envoy 8000 service via the curl -x parameter, a 400 response error will occur. The reasons for the error are as follows

https://github.com/envoyproxy/envoy/blob/2703a97f090524dddd04e100213eea4275976b7a/source/common/http/utility.cc#L415-L416

https://github.com/envoyproxy/envoy/blob/2703a97f090524dddd04e100213eea4275976b7a/source/common/http/http1/codec_impl.cc#L1141-L1144

$curl envoyproxy.io -x 127.0.0.1:8000 -v
* About to connect() to proxy 127.0.0.1 port 8000 (#0)
*   Trying 127.0.0.1...
* Connected to 127.0.0.1 (127.0.0.1) port 8000 (#0)
> GET HTTP://envoyproxy.io/ HTTP/1.1
> User-Agent: curl/7.29.0
> Host: envoyproxy.io
> Accept: */*
> Proxy-Connection: Keep-Alive
>
< HTTP/1.1 400 Bad Request
< content-length: 11
< content-type: text/plain
< date: Tue, 25 Jul 2023 04:08:33 GMT
< server: envoy
< connection: close
<
* Closing connection 0
Bad Request

Reference rfc3986 for the definition specification of scheme: Although schemes are case-insensitive, the canonical form is lowercase and documents that specify schemes must do so with lowercase letters. An implementation should accept uppercase letters as equivalent to lowercase in scheme names (e.g., allow "HTTP" as well as "http") for the sake of robustness but should only produce lowercase scheme names for consistency.

So envoy implementation of scheme field should be case-insensitive for the sake of robustness.

Contributor Guide