Index: /trunk/src/org/openstreetmap/josm/io/OsmServerReader.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/OsmServerReader.java	(revision 9173)
+++ /trunk/src/org/openstreetmap/josm/io/OsmServerReader.java	(revision 9174)
@@ -152,8 +152,6 @@
                 }
 
+                activeConnection.uncompressAccordingToContentDisposition(uncompressAccordingToContentDisposition);
                 InputStream in = new ProgressInputStream(activeConnection, progressMonitor);
-                if (uncompressAccordingToContentDisposition) {
-                    activeConnection.uncompressAccordingToContentDisposition(true);
-                }
                 return in;
             } catch (OsmTransferException e) {
Index: /trunk/src/org/openstreetmap/josm/tools/HttpClient.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/tools/HttpClient.java	(revision 9173)
+++ /trunk/src/org/openstreetmap/josm/tools/HttpClient.java	(revision 9174)
@@ -183,17 +183,19 @@
             }
             in = "gzip".equalsIgnoreCase(getContentEncoding()) ? new GZIPInputStream(in) : in;
+            Compression compression = Compression.NONE;
             if (uncompress) {
                 final String contentType = getContentType();
                 Main.debug("Uncompressing input stream according to Content-Type header: {0}", contentType);
-                in = Compression.forContentType(contentType).getUncompressedInputStream(in);
-            }
-            if (uncompressAccordingToContentDisposition) {
+                compression = Compression.forContentType(contentType);
+            }
+            if (uncompressAccordingToContentDisposition && Compression.NONE.equals(compression)) {
                 final String contentDisposition = getHeaderField("Content-Disposition");
                 final Matcher matcher = Pattern.compile("filename=\"([^\"]+)\"").matcher(contentDisposition);
                 if (matcher.find()) {
                     Main.debug("Uncompressing input stream according to Content-Disposition header: {0}", contentDisposition);
-                    in = Compression.byExtension(matcher.group(1)).getUncompressedInputStream(in);
+                    compression = Compression.byExtension(matcher.group(1));
                 }
             }
+            in = compression.getUncompressedInputStream(in);
             return in;
         }
Index: /trunk/test/unit/org/openstreetmap/josm/tools/UtilsTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/tools/UtilsTest.java	(revision 9173)
+++ /trunk/test/unit/org/openstreetmap/josm/tools/UtilsTest.java	(revision 9174)
@@ -86,5 +86,6 @@
     public void testOpenUrlGzip() throws IOException {
         Main.initApplicationPreferences();
-        try (BufferedReader x = Utils.openURLReaderAndDecompress(new URL("https://www.openstreetmap.org/trace/1613906/data"), true)) {
+        final URL url = new URL("https://www.openstreetmap.org/trace/1613906/data");
+        try (BufferedReader x = HttpClient.create(url).connect().uncompress(true).getContentReader()) {
             Assert.assertTrue(x.readLine().startsWith("<?xml version="));
         }
@@ -98,5 +99,20 @@
     public void testOpenUrlBzip() throws IOException {
         Main.initApplicationPreferences();
-        try (BufferedReader x = Utils.openURLReaderAndDecompress(new URL("https://www.openstreetmap.org/trace/785544/data"), true)) {
+        final URL url = new URL("https://www.openstreetmap.org/trace/785544/data");
+        try (BufferedReader x = HttpClient.create(url).connect().uncompress(true).getContentReader()) {
+            Assert.assertTrue(x.readLine().startsWith("<?xml version="));
+        }
+    }
+
+    /**
+     * Test of {@link Utils#openURLReaderAndDecompress} method with Bzip compression.
+     * @throws IOException if any I/O error occurs
+     */
+    @Test
+    public void testTicket9660() throws IOException {
+        Main.initApplicationPreferences();
+        final URL url = new URL("http://www.openstreetmap.org/trace/1350010/data");
+        try (BufferedReader x = HttpClient.create(url).connect()
+                .uncompress(true).uncompressAccordingToContentDisposition(true).getContentReader()) {
             Assert.assertTrue(x.readLine().startsWith("<?xml version="));
         }
