Skip to content

Commit

Permalink
fix URL joining for WMTS when URL comes from capabilities and doesn't…
Browse files Browse the repository at this point in the history
… end in a separation, fix #23980

git-svn-id: https://josm.openstreetmap.de/svn/trunk@19255 0c6e7542-c601-0410-84e7-c038aed88b3b
  • Loading branch information
stoecker committed Nov 12, 2024
1 parent 5d016df commit 7521f74
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ public class WMTSCapabilities {
* @param transferMode either KVP (key-value pairs in URL parameters) or RESTful (part of path)
*/
public WMTSCapabilities(String baseUrl, TransferMode transferMode) {
this.baseUrl = baseUrl;
if (!baseUrl.endsWith("?") && !baseUrl.endsWith("&") && !baseUrl.endsWith("/")) {
this.baseUrl = baseUrl + (baseUrl.contains("?") ? "&" : "?");
} else {
this.baseUrl = baseUrl;
}
this.transferMode = transferMode;
}

Expand Down

0 comments on commit 7521f74

Please sign in to comment.