Changeset 15742 in josm for trunk/src/org


Ignore:
Timestamp:
2020-01-20T23:18:42+01:00 (5 years ago)
Author:
simon04
Message:

HttpClient: add support for Content-Encoding: deflate

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/HttpClient.java

    r15741 r15742  
    2323import java.util.regex.Pattern;
    2424import java.util.zip.GZIPInputStream;
     25import java.util.zip.InflaterInputStream;
    2526
    2627import org.openstreetmap.josm.data.validation.routines.DomainValidator;
     
    112113        }
    113114        this.requestMethod = requestMethod;
    114         this.headers.put("Accept-Encoding", "gzip");
     115        this.headers.put("Accept-Encoding", "gzip, deflate");
    115116    }
    116117
     
    376377            InputStream in = getInputStream();
    377378            in = new ProgressInputStream(in, getContentLength(), monitor);
    378             in = "gzip".equalsIgnoreCase(getContentEncoding()) ? new GZIPInputStream(in) : in;
     379            in = "gzip".equalsIgnoreCase(getContentEncoding())
     380                    ? new GZIPInputStream(in)
     381                    : "deflate".equalsIgnoreCase(getContentEncoding())
     382                    ? new InflaterInputStream(in)
     383                    : in;
    379384            Compression compression = Compression.NONE;
    380385            if (uncompress) {
Note: See TracChangeset for help on using the changeset viewer.