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

Store HTTP headers in case-insensitive map #130

Open
akandybaev opened this issue Apr 20, 2021 · 1 comment
Open

Store HTTP headers in case-insensitive map #130

akandybaev opened this issue Apr 20, 2021 · 1 comment
Labels
status: help wanted requesting help from the community type: community enhancement feature request not on Twilio's roadmap

Comments

@akandybaev
Copy link

Issue Summary

While creating Response object the library puts all headers in java.util.HashMap which is case-sensitive (see: https://github.com/sendgrid/java-http-client/blob/main/src/main/java/com/sendgrid/Client.java#L163). It works fine when nothing messes up with headers. But when, for example, Istio sidecar is running along the application that uses SendGrid envoy proxy lower-cases all HTTP headers (e.g. X-Message-Id becomes x-message-id). In order to keep things working one has to manually write logic for looking both X-Message-Id and x-message-id which is rather inconvenient. Having headers stored in something like java.util.TreeMap with String.CASE_INSENSITIVE_ORDER comparator would make work with headers much easier.

Steps to Reproduce

Run SendGrid application along with something that manipulates headers (e.g. makes all of them lower-case).

Technical details:

  • java-http-client version: 4.3.6
  • java version: OpenJDK 11
@thinkingserious thinkingserious added status: help wanted requesting help from the community type: community enhancement feature request not on Twilio's roadmap labels Apr 21, 2021
@thinkingserious
Copy link
Contributor

Hi @akandybaev!

Thank you for the suggestion along with the detailed explanation!

This issue has been added to our internal backlog to be prioritized. Pull requests and +1s on the issue summary will help it move up the backlog.

With best regards,

Elmer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: help wanted requesting help from the community type: community enhancement feature request not on Twilio's roadmap
Projects
None yet
Development

No branches or pull requests

2 participants