Changeset 7484


Ignore:
Timestamp:
May 17, 2018, 8:46:09 AM (5 years ago)
Author:
Nicklas Nordborg
Message:

References #2118: The "freegeoip" setting should be disabled by default

This fixes the problem with the Content-Type header. It should now accept all answers that contain application/json data.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.12-stable/src/core/net/sf/basedb/util/GeoLocation.java

    r7415 r7484  
    240240     
    241241      HttpEntity entity = response.getEntity();
    242       Header contentType = entity.getContentType();
    243       if (contentType != null && !"application/json".equals(contentType.getValue()))
    244       {
    245         throw new RuntimeException("Unexpected content type: "+contentType.getValue());
     242      Header contentTypeHeader = entity.getContentType();
     243      String contentType = contentTypeHeader != null ? contentTypeHeader.getValue() : null;
     244      if (contentType != null && !contentType.contains("application/json"))
     245      {
     246        throw new RuntimeException("Unexpected content type: "+contentType);
    246247      }
    247248     
Note: See TracChangeset for help on using the changeset viewer.