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


Ignore:
Timestamp:
2018-05-31T00:51:20+02:00 (6 years ago)
Author:
wiktorn
Message:

Fix identifying if getMapUrl contains query part.

See: #16330

File:
1 edited

Legend:

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

    r13872 r13878  
    432432                        // TODO should we handle also POST?
    433433                        if ("GET".equalsIgnoreCase(mode) && getMapUrl != null && !"".equals(getMapUrl)) {
    434                             if (getMapUrl.endsWith("?")) {
    435                                 this.getMapUrl = getMapUrl;
    436                             } else {
    437                                 this.getMapUrl = getMapUrl + "?";
     434                            try {
     435                                String query = (new URL(getMapUrl)).getQuery();
     436                                if (query == null || query.isEmpty()) {
     437                                    this.getMapUrl = getMapUrl + "?";
     438                                } else {
     439                                    this.getMapUrl = getMapUrl;
     440                                }
     441                            } catch (MalformedURLException e) {
     442                                throw new XMLStreamException(e);
    438443                            }
    439444                        }
Note: See TracChangeset for help on using the changeset viewer.