Index: trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java	(revision 6866)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java	(revision 6867)
@@ -10,6 +10,8 @@
 import java.util.Arrays;
 import java.util.Collection;
+import java.util.HashSet;
 import java.util.LinkedList;
 import java.util.List;
+import java.util.Set;
 import java.util.concurrent.CopyOnWriteArrayList;
 
@@ -217,5 +219,8 @@
         MirroredInputStream in = null;
         try {
-            in = new MirroredInputStream(entry.url);
+            Set<String> mimes = new HashSet<String>();
+            mimes.addAll(Arrays.asList(XmlStyleSource.XML_STYLE_MIME_TYPES.split(", ")));
+            mimes.addAll(Arrays.asList(MapCSSStyleSource.MAPCSS_STYLE_MIME_TYPES.split(", ")));
+            in = new MirroredInputStream(entry.url, null, Utils.join(", ", mimes));
             String zipEntryPath = in.findZipEntryPath("mapcss", "style");
             if (zipEntryPath != null) {
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java	(revision 6866)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java	(revision 6867)
@@ -34,4 +34,11 @@
 
 public class MapCSSStyleSource extends StyleSource {
+
+    /**
+     * The accepted MIME types sent in the HTTP Accept header.
+     * @since 6867
+     */
+    public static final String MAPCSS_STYLE_MIME_TYPES = "text/mapcss, text/css; q=0.9, text/plain; q=0.8, application/zip, application/octet-stream; q=0.5";
+
     public final List<MapCSSRule> rules;
     private Color backgroundColorOverride;
@@ -97,5 +104,5 @@
             return new ByteArrayInputStream(css.getBytes(Utils.UTF_8));
         }
-        MirroredInputStream in = new MirroredInputStream(url);
+        MirroredInputStream in = new MirroredInputStream(url, null, MAPCSS_STYLE_MIME_TYPES);
         if (isZip) {
             File file = in.getFile();
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/xml/XmlStyleSource.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/xml/XmlStyleSource.java	(revision 6866)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/xml/XmlStyleSource.java	(revision 6867)
@@ -35,4 +35,10 @@
 public class XmlStyleSource extends StyleSource implements StyleKeys {
 
+    /**
+     * The accepted MIME types sent in the HTTP Accept header.
+     * @since 6867
+     */
+    public static final String XML_STYLE_MIME_TYPES = "application/xml, text/xml, text/plain; q=0.8, application/zip, application/octet-stream; q=0.5";
+
     protected final Map<String, IconPrototype> icons = new HashMap<String, IconPrototype>();
     protected final Map<String, LinePrototype> lines = new HashMap<String, LinePrototype>();
@@ -98,5 +104,5 @@
     @Override
     public InputStream getSourceInputStream() throws IOException {
-        MirroredInputStream in = new MirroredInputStream(url);
+        MirroredInputStream in = new MirroredInputStream(url, null, XML_STYLE_MIME_TYPES);
         InputStream zip = in.findZipEntryInputStream("xml", "style");
         if (zip != null) {
Index: trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetReader.java	(revision 6866)
+++ trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetReader.java	(revision 6867)
@@ -35,4 +35,10 @@
 public final class TaggingPresetReader {
 
+    /**
+     * The accepted MIME types sent in the HTTP Accept header.
+     * @since 6867
+     */
+    public static final String PRESET_MIME_TYPES = "application/xml, text/xml, text/plain; q=0.8, application/zip, application/octet-stream; q=0.5";
+    
     private TaggingPresetReader() {
         // Hide default constructor for utils classes
@@ -219,5 +225,5 @@
     public static Collection<TaggingPreset> readAll(String source, boolean validate) throws SAXException, IOException {
         Collection<TaggingPreset> tp;
-        MirroredInputStream s = new MirroredInputStream(source);
+        MirroredInputStream s = new MirroredInputStream(source, null, PRESET_MIME_TYPES);
         try {
             InputStream zip = s.findZipEntryInputStream("xml","preset");
Index: trunk/src/org/openstreetmap/josm/io/MirroredInputStream.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/MirroredInputStream.java	(revision 6866)
+++ trunk/src/org/openstreetmap/josm/io/MirroredInputStream.java	(revision 6867)
@@ -36,28 +36,96 @@
     public final static long DEFAULT_MAXTIME = -1L;
 
+    /**
+     * Constructs an input stream from a given filename, URL or internal resource.
+     * 
+     * @param name can be:<ul>
+     *  <li>relative or absolute file name</li>
+     *  <li>{@code file:///SOME/FILE} the same as above</li>
+     *  <li>{@code resource://SOME/FILE} file from the classpath (usually in the current *.jar)</li>
+     *  <li>{@code http://...} a URL. It will be cached on disk.</li></ul>
+     * @throws IOException when the resource with the given name could not be retrieved
+     */
     public MirroredInputStream(String name) throws IOException {
-        this(name, null, DEFAULT_MAXTIME);
-    }
-
+        this(name, null, DEFAULT_MAXTIME, null);
+    }
+
+    /**
+     * Constructs an input stream from a given filename, URL or internal resource.
+     * 
+     * @param name can be:<ul>
+     *  <li>relative or absolute file name</li>
+     *  <li>{@code file:///SOME/FILE} the same as above</li>
+     *  <li>{@code resource://SOME/FILE} file from the classpath (usually in the current *.jar)</li>
+     *  <li>{@code http://...} a URL. It will be cached on disk.</li></ul>
+     * @param maxTime the maximum age of the cache file (in seconds)
+     * @throws IOException when the resource with the given name could not be retrieved
+     */
     public MirroredInputStream(String name, long maxTime) throws IOException {
-        this(name, null, maxTime);
-    }
-
+        this(name, null, maxTime, null);
+    }
+
+    /**
+     * Constructs an input stream from a given filename, URL or internal resource.
+     * 
+     * @param name can be:<ul>
+     *  <li>relative or absolute file name</li>
+     *  <li>{@code file:///SOME/FILE} the same as above</li>
+     *  <li>{@code resource://SOME/FILE} file from the classpath (usually in the current *.jar)</li>
+     *  <li>{@code http://...} a URL. It will be cached on disk.</li></ul>
+     * @param destDir the destination directory for the cache file. Only applies for URLs.
+     * @throws IOException when the resource with the given name could not be retrieved
+     */
     public MirroredInputStream(String name, String destDir) throws IOException {
-        this(name, destDir, DEFAULT_MAXTIME);
-    }
-
-    /**
-     * Get an inputstream from a given filename, url or internal resource.
-     * @param name can be
-     *  - relative or absolute file name
-     *  - file:///SOME/FILE the same as above
-     *  - resource://SOME/FILE file from the classpath (usually in the current *.jar)
-     *  - http://... a url. It will be cached on disk.
-     * @param destDir the destination directory for the cache file. only applies for urls.
+        this(name, destDir, DEFAULT_MAXTIME, null);
+    }
+
+    /**
+     * Constructs an input stream from a given filename, URL or internal resource.
+     * 
+     * @param name can be:<ul>
+     *  <li>relative or absolute file name</li>
+     *  <li>{@code file:///SOME/FILE} the same as above</li>
+     *  <li>{@code resource://SOME/FILE} file from the classpath (usually in the current *.jar)</li>
+     *  <li>{@code http://...} a URL. It will be cached on disk.</li></ul>
+     * @param destDir the destination directory for the cache file. Only applies for URLs.
      * @param maxTime the maximum age of the cache file (in seconds)
      * @throws IOException when the resource with the given name could not be retrieved
      */
     public MirroredInputStream(String name, String destDir, long maxTime) throws IOException {
+        this(name, destDir, maxTime, null);
+    }
+
+    /**
+     * Constructs an input stream from a given filename, URL or internal resource.
+     * 
+     * @param name can be:<ul>
+     *  <li>relative or absolute file name</li>
+     *  <li>{@code file:///SOME/FILE} the same as above</li>
+     *  <li>{@code resource://SOME/FILE} file from the classpath (usually in the current *.jar)</li>
+     *  <li>{@code http://...} a URL. It will be cached on disk.</li></ul>
+     * @param destDir the destination directory for the cache file. Only applies for URLs.
+     * @param httpAccept The accepted MIME types sent in the HTTP Accept header. Only applies for URLs.
+     * @throws IOException when the resource with the given name could not be retrieved
+     * @since 6867
+     */
+    public MirroredInputStream(String name, String destDir, String httpAccept) throws IOException {
+        this(name, destDir, DEFAULT_MAXTIME, httpAccept);
+    }
+
+    /**
+     * Constructs an input stream from a given filename, URL or internal resource.
+     * 
+     * @param name can be:<ul>
+     *  <li>relative or absolute file name</li>
+     *  <li>{@code file:///SOME/FILE} the same as above</li>
+     *  <li>{@code resource://SOME/FILE} file from the classpath (usually in the current *.jar)</li>
+     *  <li>{@code http://...} a URL. It will be cached on disk.</li></ul>
+     * @param destDir the destination directory for the cache file. Only applies for URLs.
+     * @param maxTime the maximum age of the cache file (in seconds)
+     * @param httpAccept The accepted MIME types sent in the HTTP Accept header. Only applies for URLs.
+     * @throws IOException when the resource with the given name could not be retrieved
+     * @since 6867
+     */
+    public MirroredInputStream(String name, String destDir, long maxTime, String httpAccept) throws IOException {
         URL url;
         try {
@@ -73,5 +141,5 @@
                     file = new File(url.getFile());
                 } else {
-                    file = checkLocal(url, destDir, maxTime);
+                    file = checkLocal(url, destDir, maxTime, httpAccept);
                 }
             }
@@ -201,5 +269,5 @@
     }
 
-    private File checkLocal(URL url, String destDir, long maxTime) throws IOException {
+    private File checkLocal(URL url, String destDir, long maxTime, String httpAccept) throws IOException {
         String prefKey = getPrefKey(url, destDir);
         long age = 0L;
@@ -237,5 +305,5 @@
         BufferedInputStream bis = null;
         try {
-            HttpURLConnection con = connectFollowingRedirect(url);
+            HttpURLConnection con = connectFollowingRedirect(url, httpAccept);
             bis = new BufferedInputStream(con.getInputStream());
             FileOutputStream fos = new FileOutputStream(destDirFile);
@@ -284,10 +352,11 @@
      * 
      * @param downloadUrl The resource URL to download
+     * @param httpAccept The accepted MIME types sent in the HTTP Accept header. Can be {@code null}
      * @return The HTTP connection effectively linked to the resource, after all potential redirections
      * @throws MalformedURLException If a redirected URL is wrong
      * @throws IOException If any I/O operation goes wrong
-     * @since 6073
-     */
-    public static HttpURLConnection connectFollowingRedirect(URL downloadUrl) throws MalformedURLException, IOException {
+     * @since 6867
+     */
+    public static HttpURLConnection connectFollowingRedirect(URL downloadUrl, String httpAccept) throws MalformedURLException, IOException {
         HttpURLConnection con = null;
         int numRedirects = 0;
@@ -297,4 +366,9 @@
             con.setConnectTimeout(Main.pref.getInteger("socket.timeout.connect",15)*1000);
             con.setReadTimeout(Main.pref.getInteger("socket.timeout.read",30)*1000);
+            Main.debug("GET "+downloadUrl);
+            if (httpAccept != null) {
+                Main.debug("Accept: "+httpAccept);
+                con.setRequestProperty("Accept", httpAccept);
+            }
             try {
                 con.connect();
Index: trunk/src/org/openstreetmap/josm/plugins/PluginDownloadTask.java
===================================================================
--- trunk/src/org/openstreetmap/josm/plugins/PluginDownloadTask.java	(revision 6866)
+++ trunk/src/org/openstreetmap/josm/plugins/PluginDownloadTask.java	(revision 6867)
@@ -36,4 +36,11 @@
  */
 public class PluginDownloadTask extends PleaseWaitRunnable{
+
+    /**
+     * The accepted MIME types sent in the HTTP Accept header.
+     * @since 6867
+     */
+    public static final String PLUGIN_MIME_TYPES = "application/java-archive, application/zip; q=0.9, application/octet-stream; q=0.5";
+    
     private final Collection<PluginInformation> toUpdate = new LinkedList<PluginInformation>();
     private final Collection<PluginInformation> failed = new LinkedList<PluginInformation>();
@@ -120,5 +127,5 @@
             URL url = new URL(pi.downloadlink);
             synchronized(this) {
-                downloadConnection = MirroredInputStream.connectFollowingRedirect(url);
+                downloadConnection = MirroredInputStream.connectFollowingRedirect(url, PLUGIN_MIME_TYPES);
             }
             in = downloadConnection.getInputStream();
