Skip to content

Commit 31ab3bb

Browse files
authoredFeb 6, 2019
Merge pull request #9115 from m-kuhn/wmts-getcapabilities-compat
Append ? to WMTS GetCapabilities
2 parents d92f9e7 + 76ac0f1 commit 31ab3bb

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed
 

‎src/server/services/wmts/qgswmtsgetcapabilities.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,12 @@ namespace QgsWmts
272272
QDomElement httpElement = doc.createElement( QStringLiteral( "ows:HTTP" )/*ows:HTTP*/ );
273273
dcpElement.appendChild( httpElement );
274274

275-
//Prepare url
276-
QString hrefString = serviceUrl( request, project );
275+
// Get service URL
276+
const QUrl href = serviceUrl( request, project );
277+
278+
//href needs to be a prefix
279+
QString hrefString = href.toString();
280+
hrefString.append( href.hasQuery() ? '&' : '?' );
277281

278282
//ows:Get
279283
QDomElement getElement = doc.createElement( QStringLiteral( "ows:Get" )/*ows:Get*/ );

‎tests/testdata/qgis_server/wmts_getcapabilities_config.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,21 @@ Content-Type: text/xml; charset=utf-8
2020
<ows:Operation name="GetCapabilities">
2121
<ows:DCP>
2222
<ows:HTTP>
23-
<ows:Get xlink:href="https://www.qgis.org/"/>
23+
<ows:Get xlink:href="https://www.qgis.org/?"/>
2424
</ows:HTTP>
2525
</ows:DCP>
2626
</ows:Operation>
2727
<ows:Operation name="GetTile">
2828
<ows:DCP>
2929
<ows:HTTP>
30-
<ows:Get xlink:href="https://www.qgis.org/"/>
30+
<ows:Get xlink:href="https://www.qgis.org/?"/>
3131
</ows:HTTP>
3232
</ows:DCP>
3333
</ows:Operation>
3434
<ows:Operation name="GetFeatureInfo">
3535
<ows:DCP>
3636
<ows:HTTP>
37-
<ows:Get xlink:href="https://www.qgis.org/"/>
37+
<ows:Get xlink:href="https://www.qgis.org/?"/>
3838
</ows:HTTP>
3939
</ows:DCP>
4040
</ows:Operation>

‎tests/testdata/qgis_server/wmts_getcapabilities_config_3857.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,21 @@ Content-Type: text/xml; charset=utf-8
2020
<ows:Operation name="GetCapabilities">
2121
<ows:DCP>
2222
<ows:HTTP>
23-
<ows:Get xlink:href="https://www.qgis.org/"/>
23+
<ows:Get xlink:href="https://www.qgis.org/?"/>
2424
</ows:HTTP>
2525
</ows:DCP>
2626
</ows:Operation>
2727
<ows:Operation name="GetTile">
2828
<ows:DCP>
2929
<ows:HTTP>
30-
<ows:Get xlink:href="https://www.qgis.org/"/>
30+
<ows:Get xlink:href="https://www.qgis.org/?"/>
3131
</ows:HTTP>
3232
</ows:DCP>
3333
</ows:Operation>
3434
<ows:Operation name="GetFeatureInfo">
3535
<ows:DCP>
3636
<ows:HTTP>
37-
<ows:Get xlink:href="https://www.qgis.org/"/>
37+
<ows:Get xlink:href="https://www.qgis.org/?"/>
3838
</ows:HTTP>
3939
</ows:DCP>
4040
</ows:Operation>

0 commit comments

Comments
 (0)
Please sign in to comment.