awslabs / disco

A suite of tools including a framework for creating Java Agents, for aspect-oriented tooling for distributed systems.
Apache License 2.0
55 stars 12 forks source link

Make all header operations case-insensitive #14

Open willarmiros opened 3 years ago

willarmiros commented 3 years ago

Right now, header data is stored internally using a regular Map. Right now, if you are consuming a ProtocolEvent and would like to get header data, you do something like this:

String headerData = httpNetworkProtocolRequestEvent.getHeaderData("x-forwarded-for");

However if the header is stored internally as X-Forwarded-For or some other casing, the above returns null despite the header being present. We should consider switching to using a TreeMap or similar implementation which can use case-insensitive keys, because header keys are case-insensitive.