Make all header operations case-insensitive
- Dominant language
- Java
- Stars
- 70
- Forks
- 12
- PR merge metrics
- No merged PRs in 30d
Description
Right now, header data is stored internally using a regular [Map](https://github.com/awslabs/disco/blob/master/disco-java-agent/disco-java-agent-api/src/main/java/software/amazon/disco/agent/event/AbstractProtocolEvent.java#L49). Right now, if you are consuming a `ProtocolEvent` and would like to get header data, you do something like this:
```java
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.
Contributor guide
Research direction
Start with AbstractProtocolEvent.java, especially the internal header Map and the getHeaderData entry point described in the issue. Trace how ProtocolEvent headers are stored and retrieved, then verify that lookups succeed regardless of header-key casing and that existing header behavior remains intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 50/100