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

Kafka header names are not case sensitive in REST API #175

Open
hansut opened this issue Sep 26, 2019 · 5 comments
Open

Kafka header names are not case sensitive in REST API #175

hansut opened this issue Sep 26, 2019 · 5 comments

Comments

@hansut
Copy link

hansut commented Sep 26, 2019

Hello, when we try to add some Kafka headers when producing a message using the REST API, their keys in Kafka don't keep the original case. For example:

"X-Kafka-APP_REQUEST_UUID" gets to Kafka as "App_request_uuid"
"X-Kafka-__TypeId__" gets to Kafka as "__typeid__"

Would it be possible to fix it?

@horkhe
Copy link
Member

horkhe commented Sep 28, 2019

Is your application written in Go? If so then it is the Go HTTP client that performs header name normalisation. Try testing with curl. Kafka-Pixy itself does not modify header name case.

@hansut
Copy link
Author

hansut commented Sep 30, 2019

No, I am using Postman. But I've just tried with SoapUI and curl, and the result is the same.

@horkhe
Copy link
Member

horkhe commented Sep 30, 2019

I looked into the Golang HTTP server implementation and turns out it performs header name normalisation before passing request data to the Kafka-Pixy handler. So it is impossible to preserver the original header case, unless we implement an alternative way to pass Kafka headers that is via request parameters rather than request headers. It should be a small change, but I do not have time to do that right now. If you really need it you can suggest a PR.

@hansut
Copy link
Author

hansut commented Sep 30, 2019

Thank you for the quick analysis. How can I suggest a PR? From my experience, pull requests are open by the developers who actually implement a change/bugfix, and I actually don't feel to be the right person for implementing this change as I am not familiar with the Go language.
Anyway it is not so urgent for me, so I suggest to label it as bug or change request and fix it when possible.

@horkhe
Copy link
Member

horkhe commented Sep 30, 2019

I was suggesting you to make the change, but if you are not familiar with the language then it makes sense to just table it for later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants