Document HttpHeaders#toSingleValueMap() case-sensitive behavior
The map returned by HttpHeaders.toSingleValueMap() is not case-insensitive.
This copy also ensures that collection-iterating methods like
entrySet()are case-insensitive.
var response = restTemplate.getForEntity(uri, String.class); assertTrue(response.getHeaders().containsHeader("date"); // passes assertTrue(response.getHeaders().containsHeader("Date"); // passes assertTrue(response.getHeaders().toSingleValueMap().keySet().contains("date"); // passes assertTrue(response.getHeaders().toSingleValueMap().keySet().contains("Date"); // fails
Which case they're been normalised to depends on the request factory.
Tested with Spring Framework 7.0.2 (via Boot 4.0.1).