-
Notifications
You must be signed in to change notification settings - Fork 932
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
kubectl-proxy changes http-header-keys to capitalized #1673
Comments
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 The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Since the headers are case-insensitive, does it matter that these headers are capitalized or not?. Wouldn't eventually all be considered as same?. |
Thanks for your reply. |
Looking through the code, the proxy command's RunProxy method calls Server.ServeOnListener, which itself starts an http.Server instance listening for requests on the requested address and port or Unix socket. When a request is received the http.Server instance creates an http.Request object and passes it to a handler. Go's http package defines a canonical header format, in which the first letter and any letter immediately following a hyphen are upper-cased and all others are converted to lowercase. Methods on the Header type automatically convert names to canonical form. So this looks like a Go implementation detail rather than something done deliberately by |
/priority awaiting-more-evidence per #1673 (comment) |
What happened:
![image](https://private-user-images.githubusercontent.com/36868900/377688331-37970f81-e12a-468c-8ab6-6e14f86d1c0e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk4NDM5NjIsIm5iZiI6MTczOTg0MzY2MiwicGF0aCI6Ii8zNjg2ODkwMC8zNzc2ODgzMzEtMzc5NzBmODEtZTEyYS00NjhjLThhYjYtNmUxNGY4NmQxYzBlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE4VDAxNTQyMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTcwNjg3ZDRlNjFmNzMwNDIxNGU1YzBiOWNjMDI5NjVhNjU4ZTllMzI5NmIwMzkzOTM5OWMwZThiNTFmZTU3OWImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.p0Ni6DtJ_i9ixGm-eQ0hsNhu3fKQX3NP7Jf6TBd_yuE)
When I am using
kubectl proxy
, the past proxy http request header keys are converted to initial capital.What you expected to happen:
HTTP/1.1
According to RFC 7230, section 3.2:
HTTP/2.0
Quoting RFC 7540, section 8.1.2:
How to reproduce it (as minimally and precisely as possible):
Use
kubectl proxy
and log all headers in svc-podsAnything 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
local
The text was updated successfully, but these errors were encountered: