Ignore:
Timestamp:
2014-02-18T00:35:15+01:00 (10 years ago)
Author:
Don-vip
Message:

fix #9715 - Set HTTP Accept header to expected MIME types when downloading presets, styles, plugins

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/plugins/PluginDownloadTask.java

    r6643 r6867  
    3636 */
    3737public class PluginDownloadTask extends PleaseWaitRunnable{
     38
     39    /**
     40     * The accepted MIME types sent in the HTTP Accept header.
     41     * @since 6867
     42     */
     43    public static final String PLUGIN_MIME_TYPES = "application/java-archive, application/zip; q=0.9, application/octet-stream; q=0.5";
     44   
    3845    private final Collection<PluginInformation> toUpdate = new LinkedList<PluginInformation>();
    3946    private final Collection<PluginInformation> failed = new LinkedList<PluginInformation>();
     
    120127            URL url = new URL(pi.downloadlink);
    121128            synchronized(this) {
    122                 downloadConnection = MirroredInputStream.connectFollowingRedirect(url);
     129                downloadConnection = MirroredInputStream.connectFollowingRedirect(url, PLUGIN_MIME_TYPES);
    123130            }
    124131            in = downloadConnection.getInputStream();
Note: See TracChangeset for help on using the changeset viewer.