Changeset 9174 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2015-12-27T00:07:00+01:00 (9 years ago)
Author:
simon04
Message:

see #12231 - Update unit tests, fix regression

Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

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

    r9172 r9174  
    152152                }
    153153
     154                activeConnection.uncompressAccordingToContentDisposition(uncompressAccordingToContentDisposition);
    154155                InputStream in = new ProgressInputStream(activeConnection, progressMonitor);
    155                 if (uncompressAccordingToContentDisposition) {
    156                     activeConnection.uncompressAccordingToContentDisposition(true);
    157                 }
    158156                return in;
    159157            } catch (OsmTransferException e) {
  • trunk/src/org/openstreetmap/josm/tools/HttpClient.java

    r9173 r9174  
    183183            }
    184184            in = "gzip".equalsIgnoreCase(getContentEncoding()) ? new GZIPInputStream(in) : in;
     185            Compression compression = Compression.NONE;
    185186            if (uncompress) {
    186187                final String contentType = getContentType();
    187188                Main.debug("Uncompressing input stream according to Content-Type header: {0}", contentType);
    188                 in = Compression.forContentType(contentType).getUncompressedInputStream(in);
    189             }
    190             if (uncompressAccordingToContentDisposition) {
     189                compression = Compression.forContentType(contentType);
     190            }
     191            if (uncompressAccordingToContentDisposition && Compression.NONE.equals(compression)) {
    191192                final String contentDisposition = getHeaderField("Content-Disposition");
    192193                final Matcher matcher = Pattern.compile("filename=\"([^\"]+)\"").matcher(contentDisposition);
    193194                if (matcher.find()) {
    194195                    Main.debug("Uncompressing input stream according to Content-Disposition header: {0}", contentDisposition);
    195                     in = Compression.byExtension(matcher.group(1)).getUncompressedInputStream(in);
     196                    compression = Compression.byExtension(matcher.group(1));
    196197                }
    197198            }
     199            in = compression.getUncompressedInputStream(in);
    198200            return in;
    199201        }
Note: See TracChangeset for help on using the changeset viewer.