envoyproxy/envoy

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

Open

#28,594 建立於 2023年7月25日

在 GitHub 查看
 (3 留言) (0 反應) (0 負責人)C++ (5,373 fork)batch import
area/httpbughelp wanted

倉庫指標

Star
 (27,997 star)
PR 合併指標
 (平均合併 8天) (30 天內合併 378 個 PR)

描述

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.

貢獻者指南