Changeset 9807 in josm for trunk/test


Ignore:
Timestamp:
2016-02-15T23:39:36+01:00 (9 years ago)
Author:
wiktorn
Message:

Make map returned by getHeaderFields() case insensitive.

RFC 2616, section 4.2, specifies that header names are case insensitive. This is properly handled by getHeaderField(...) in HttpUrlConnection, but in case of getHeaderFields() Map returned by Oracle JDK is case sensitive. By using case insentive map we avoid bigger refactoring of all usages, to use getHeaderField(...) where appropiate.

See #12235: Java Web Start cache returns all headers as lowercase, when real server return mixed case.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/functional/org/openstreetmap/josm/tools/HttpClientTest.java

    r9669 r9807  
    6969        assertThat(response.getHeaderField("Content-TYPE"), is("application/json"));
    7070        assertThat(response.getHeaderFields().get("Content-Type"), is(Collections.singletonList("application/json")));
    71         assertThat(response.getHeaderFields().get("Content-TYPE"), nullValue());
     71        assertThat(response.getHeaderFields().get("Content-TYPE"), is(Collections.singletonList("application/json")));
    7272        try (final InputStream in = response.getContent();
    7373             final JsonReader json = JsonProvider.provider().createReader(in)) {
Note: See TracChangeset for help on using the changeset viewer.