Description
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