Changeset 29719 in osm for applications/editors


Ignore:
Timestamp:
2013-06-28T04:11:28+02:00 (12 years ago)
Author:
donvip
Message:

[josm_directupload] fix #josm7590 - correct use of OSM API URL in order to reuse known credentials + use of user-agent

Location:
applications/editors/josm/plugins/DirectUpload
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/DirectUpload/build.xml

    r29718 r29719  
    55    <property name="commit.message" value="applied JOSM Ticket 4498 (patch by ax) - oauth support for gpx upload (I accidentally committed parts of the path in [24236])"/>
    66    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    7     <property name="plugin.main.version" value="5053"/>
     7    <property name="plugin.main.version" value="5587"/>
    88
    99    <!-- Configure these properties (replace "..." accordingly).
  • applications/editors/josm/plugins/DirectUpload/src/org/openstreetmap/josm/plugins/DirectUpload/UploadDataGui.java

    r29718 r29719  
    4242import org.openstreetmap.josm.gui.widgets.HistoryComboBox;
    4343import org.openstreetmap.josm.io.GpxWriter;
     44import org.openstreetmap.josm.io.OsmApi;
    4445import org.openstreetmap.josm.tools.GBC;
    4546import org.openstreetmap.josm.tools.UrlLabel;
     47import org.openstreetmap.josm.tools.Utils;
    4648
    4749/**
     
    9698
    9799    // Constants used when generating upload request
    98     private static final String API_VERSION = "0.6";
    99100    private static final String BOUNDARY = "----------------------------d10f7aa230e8";
    100101    private static final String LINE_END = "\r\n";
     
    285286
    286287        // Upload URL
    287         URL url = new URL("http://www.openstreetmap.org/api/" + API_VERSION + "/gpx/create");
     288        URL url = new URL(OsmApi.getOsmApi().getBaseUrl() + "gpx/create");
    288289
    289290        // Set up connection and log in
    290         HttpURLConnection c = (HttpURLConnection) url.openConnection();
     291        HttpURLConnection c = Utils.openHttpConnection(url);
    291292        c.setFixedLengthStreamingMode(contentLength);
    292293        c.setConnectTimeout(15000);
Note: See TracChangeset for help on using the changeset viewer.