Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes the appending of the query string.
I wanted to use this service in MapsUi:
https://geoservices5.civis.bz.it/geoserver/p_bz-Cadastre/ows
When using it like above, the query string got added like this:
https://geoservices5.civis.bz.it/geoserver/p_bz-Cadastre/ows&SERVICE=WMS&REQUEST=GetMap&BBOX=...
wich resulted in an error 404.I then added
?REQUEST=GetCapabilities
to my service url:https://geoservices5.civis.bz.it/geoserver/p_bz-Cadastre/ows?REQUEST=GetCapabilities
which created this url:
/geoserver/p_bz-Cadastre/ows?REQUEST=GetCapabilities&SERVICE=WMS&REQUEST=GetMap&BBOX=
and this error:
There are 2 workarounds:
Add request as lowercase string as in the wms sample
https://geoservices5.civis.bz.it/geoserver/p_bz-Cadastre/ows?request=GetCapabilities
In this case there is still a
REQUEST=GetMap
added and the lowercase request makes some confusion.Add any dummy parameter
https://geoservices5.civis.bz.it/geoserver/p_bz-Cadastre/ows?dummy
With this PR you can use the url without query parameters as source (e.g.
https://geoservices5.civis.bz.it/geoserver/p_bz-Cadastre/ows
) which makes it more obvious.We could further improve it to completely replace the existing query parameters. I already prepared a solution, can push it if you decide to go this way (it uses an utility class named QueryString):