Store HTTP headers in case-insensitive map #130
Labels
status: help wanted
requesting help from the community
type: community enhancement
feature request not on Twilio's roadmap
Issue Summary
While creating
Response
object the library puts all headers injava.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
becomesx-message-id
). In order to keep things working one has to manually write logic for looking bothX-Message-Id
andx-message-id
which is rather inconvenient. Having headers stored in something likejava.util.TreeMap
withString.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:
The text was updated successfully, but these errors were encountered: