scheme field should be case-insensitive for the sake of robustness
- Dominant language
- C++
- Stars
- 28.9k
- Forks
- 5.6k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 437
Description
*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](https://www.rfc-editor.org/rfc/rfc3986#section-3.1): _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
Assessment
This issue has not been assessed yet.