kubernetes / kubectl

Issue tracker and mirror of kubectl code
Apache License 2.0
2.85k stars 921 forks source link

kubectl-proxy changes http-header-keys to capitalized #1673

Open faxjiangyi opened 2 days ago

faxjiangyi commented 2 days ago

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
k8s-ci-robot commented 2 days ago

This issue is currently awaiting triage.

SIG CLI takes a lead on issue triage for this repo, but any Kubernetes member can accept issues by applying the triage/accepted label.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.