Skip to content
Permalink
Browse files

Append ? to WMTS GetCapabilities

This makes WMTS behave equal to the WMS implementation which already appends a ? in case there is no query string supplied.

Some parsers rely on a terminating ? to work properly.
  • Loading branch information
m-kuhn committed Feb 6, 2019
1 parent 87a1cb5 commit 5dd83884692cc09874da594778ed900474ec9b39
Showing with 6 additions and 2 deletions.
  1. +6 −2 src/server/services/wmts/qgswmtsgetcapabilities.cpp
@@ -272,8 +272,12 @@ namespace QgsWmts
QDomElement httpElement = doc.createElement( QStringLiteral( "ows:HTTP" )/*ows:HTTP*/ );
dcpElement.appendChild( httpElement );

//Prepare url
QString hrefString = serviceUrl( request, project );
// Get service URL
const QUrl href = serviceUrl( request, project );

//href needs to be a prefix
QString hrefString = href.toString();
hrefString.append( href.hasQuery() ? '&' : '?' );

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

0 comments on commit 5dd8388

Please sign in to comment.
You can’t perform that action at this time.