kubectl icon indicating copy to clipboard operation
kubectl copied to clipboard

kubectl-proxy changes http-header-keys to capitalized

Open faxjiangyi opened this issue 1 year ago • 1 comments

What happened: When I am using kubectl proxy, the past proxy http request header keys are converted to initial capital. image

What you expected to happen: HTTP/1.1 According to RFC 7230, section 3.2:

Each header field consists of a case-insensitive field name followed by a colon (":"), optional leading whitespace, the field value, and optional trailing whitespace.

HTTP/2.0 Quoting RFC 7540, section 8.1.2:

Just as in HTTP/1.x, header field names are strings of ASCII characters that are compared in a case-insensitive fashion.

How to reproduce it (as minimally and precisely as possible): Use kubectl proxy and log all headers in svc-pods

Anything else we need to know?: Happened both in aks and local k3s. I'm not sure if this is a bug or intended?

Environment: aks

Client Version: v1.29.4
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.28.9

local

Client Version: v1.29.4
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.29.3+orb1

faxjiangyi avatar Oct 18 '24 01:10 faxjiangyi