-
Notifications
You must be signed in to change notification settings - Fork 269
Open
Description
What would you like to be improved?
According to https://www.ietf.org/rfc/rfc2616.txt (4.2 Message Headers), HTTP headers are case insensitive.
The Metadata should handle all the case sensitivities, not just lowercase.
Example test case:
@Test
void testGetFirstValueShouldReturnValueWithoutDependingOnCaseSensitivity() {
Metadata metadata = new Metadata();
metadata.addValue("location", "http://example.com");
Assertions.assertEquals("http://example.com", metadata.getFirstValue("location"));
Assertions.assertEquals("http://example.com", metadata.getFirstValue("Location"));
Assertions.assertEquals("http://example.com", metadata.getFirstValue("LOCATION"));
Metadata metadata2 = new Metadata();
metadata2.addValue("Location", "http://example.com");
Assertions.assertEquals("http://example.com", metadata2.getFirstValue("location"));
Assertions.assertEquals("http://example.com", metadata2.getFirstValue("Location"));
Assertions.assertEquals("http://example.com", metadata2.getFirstValue("LOCATION"));
Metadata metadata3 = new Metadata();
metadata3.addValue("LOCATION", "http://example.com");
Assertions.assertEquals("http://example.com", metadata3.getFirstValue("location"));
Assertions.assertEquals("http://example.com", metadata3.getFirstValue("Location"));
Assertions.assertEquals("http://example.com", metadata3.getFirstValue("LOCATION"));
}How should we improve?
No response