Changeset 17543 in josm for trunk/src/org


Ignore:
Timestamp:
2021-02-26T00:33:30+01:00 (4 years ago)
Author:
Don-vip
Message:

fix #20535 - strip leading/trailing whitespace from URLs entered in "Add WMS/WMTS" dialogs

Location:
trunk/src/org/openstreetmap/josm/gui/preferences/imagery
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddWMSLayerPanel.java

    r15717 r17543  
    3030import org.openstreetmap.josm.tools.GBC;
    3131import org.openstreetmap.josm.tools.Logging;
     32import org.openstreetmap.josm.tools.Utils;
    3233
    3334/**
     
    8384        getLayers.addActionListener(e -> {
    8485            try {
    85                 wms = new WMSImagery(rawUrl.getText(), getCommonHeaders());
     86                wms = new WMSImagery(Utils.strip(rawUrl.getText()), getCommonHeaders());
    8687                tree.updateTree(wms);
    8788                Collection<String> wmsFormats = wms.getFormats();
  • trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddWMTSLayerPanel.java

    r15805 r17543  
    2424import org.openstreetmap.josm.tools.GBC;
    2525import org.openstreetmap.josm.tools.Logging;
     26import org.openstreetmap.josm.tools.Utils;
    2627
    2728/**
     
    6162        getLayers.addActionListener(e -> {
    6263            try {
    63                 WMTSCapabilities capabilities = WMTSTileSource.getCapabilities(rawUrl.getText(), getCommonHeaders());
     64                WMTSCapabilities capabilities = WMTSTileSource.getCapabilities(Utils.strip(rawUrl.getText()), getCommonHeaders());
    6465                layerTable = new WMTSLayerSelection(WMTSTileSource.groupLayersByNameAndTileMatrixSet(capabilities.getLayers()));
    6566                layerTable.getTable().getSelectionModel().addListSelectionListener(lsl -> {
Note: See TracChangeset for help on using the changeset viewer.