Changeset 7267 in josm for trunk/src


Ignore:
Timestamp:
2014-06-24T22:23:23+02:00 (5 years ago)
Author:
Don-vip
Message:

fix #10172 - Cannot open GPX from URL without Content-Disposition http header

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/OsmServerReader.java

    r7082 r7267  
    216216
    217217    private InputStream uncompressAccordingToContentDisposition(InputStream stream, Map<String, List<String>> headerFields) throws IOException {
    218         if (headerFields.get("Content-Disposition").toString().contains(".gz\"")) {
     218        List<String> field = headerFields.get("Content-Disposition");
     219        if (field != null && field.toString().contains(".gz\"")) {
    219220            return Compression.GZIP.getUncompressedInputStream(stream);
    220         } else if (headerFields.get("Content-Disposition").toString().contains(".bz2\"")) {
     221        } else if (field != null && field.toString().contains(".bz2\"")) {
    221222            return Compression.BZIP2.getUncompressedInputStream(stream);
    222223        } else {
Note: See TracChangeset for help on using the changeset viewer.