Skip to content
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

Http Addon Scaler Camel-casing the response Headers. #942

Open
kissandas opened this issue Mar 15, 2024 · 4 comments
Open

Http Addon Scaler Camel-casing the response Headers. #942

kissandas opened this issue Mar 15, 2024 · 4 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@kissandas
Copy link

kissandas commented Mar 15, 2024

Report

We sending request to HttPScaler, the response header names are getting camel-casing.
For example-
Request Header : vf-trace-transaction-id: c340af6-2377-44a3-a363-bc21cc423fb

Response Header : Vf-Trace-Transaction-Id: c340af6-2377-44a3-a363-bc21cc423fb

Expected Behavior

HTTP/1.1 200 OK
Date: Fri, 15 Mar 2024 07:48:26 GMT
vf-Trace-transaction-id: c340af6-2377-44a3-a363-bc21cc423fb
X-Keda-Http-Cold-Start: false

Actual Behavior

HTTP/1.1 200 OK
Date: Fri, 15 Mar 2024 07:48:27 GMT
Vf-Trace-Transaction-Id: c340af6-2377-44a3-a363-bc21cc423fb

Steps to Reproduce the Problem

  1. Send a request passing through HttPScalerObject
  2. Check the response Headers for Camel-casing

Logs from KEDA HTTP operator

example

2024/03/12 14:17:43 maxprocs: Updating GOMAXPROCS=1: using minimum allowed GOMAXPROCS
2024-03-12T14:17:44Z INFO setup Starting manager
2024-03-12T14:17:44Z INFO setup KEDA Version: 2.13.1
2024-03-12T14:17:44Z INFO setup Git Commit: 41dd7a8558fdb274f2c0861f6c6d1eba01f2dcd5
2024-03-12T14:17:44Z INFO setup Go Version: go1.21.6
2024-03-12T14:17:44Z INFO setup Go OS/Arch: linux/amd64
2024-03-12T14:17:44Z INFO setup Running on Kubernetes 1.24 {"version": "v1.24.17"}
2024-03-12T14:17:44Z INFO setup WARNING: KEDA 2.13.1 hasn't been tested on Kubernetes v1.24.17

HTTP Add-on Version

0.7.0

Kubernetes Version

< 1.27

Platform

Amazon Web Services

Anything else?

Its bit urgent as due to this our logging is not working.

@kissandas kissandas added the bug Something isn't working label Mar 15, 2024
@JorTurFer
Copy link
Member

Hello,
Technically this is not a bug because the RFC describes the header fields as case-insensitive: https://www.rfc-editor.org/rfc/rfc7540#section-8.1.2

Said that, I guess that we can check if there is any way to not modify them at all (it's the golang runtime proxy who does it, we aren't changing them in the code)

Are you willing to contribute with the fix?

@kissandas
Copy link
Author

Thanks a lot for your quick response. I am really sorry I can't contribute now. Is there any workaround to bypass this as its impacting our logging flow ? Please suggest.

@JorTurFer
Copy link
Member

JorTurFer commented Mar 31, 2024

It can't be bypassed AFAIK. Bypass is solving indeed xD
The golang proxy is replacing the headers given that they are case-insensitive based on the RFC, so it's not a bug with a workaround, all the requests use the proxy

@JorTurFer JorTurFer added the help wanted Extra attention is needed label Apr 4, 2024
@PatxD
Copy link

PatxD commented Apr 24, 2024

This is the same problem as with Traefik ingress. We had to use Nginx ingress for a project that had a hard requirement on non-rfc headers.
iirc, the issue was opened at the go library level, and it was refused. So I don't think this is something that will be "fixed". The answer is basically "make your code rfc compliant".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants