awslabs / awslabs/disco

Make all header operations case-insensitive

Open
#14 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.