Skip to content

Commit cfe747c

Browse files

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed
 

‎src/plugins/wfs/qgswfssourceselect.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,6 @@ int QgsWFSSourceSelect::getCapabilities(const QString& uri, QgsWFSSourceSelect::
137137

138138
int QgsWFSSourceSelect::getCapabilitiesGET(QString uri, std::list<QString>& typenames, std::list< std::list<QString> >& crs, std::list<QString>& titles, std::list<QString>& abstracts)
139139
{
140-
if(!(uri.contains("?")))
141-
{
142-
uri.append("?");
143-
}
144140
QString request = uri + "SERVICE=WFS&REQUEST=GetCapabilities&VERSION=1.0.0";
145141

146142
QByteArray result;
@@ -280,6 +276,16 @@ void QgsWFSSourceSelect::connectToServer()
280276
std::list<QString> titles;
281277
std::list<QString> abstracts;
282278

279+
//modify mUri to add '?' or '&' at the end if it is not already there
280+
if ( !(mUri.contains("?")) )
281+
{
282+
mUri.append("?");
283+
}
284+
else if ((mUri.right(1) != "?") && (mUri.right(1) != "&"))
285+
{
286+
mUri.append("&");
287+
}
288+
283289
if(getCapabilities(mUri, QgsWFSSourceSelect::GET, typenames, crsList, titles, abstracts) != 0)
284290
{
285291
qWarning("error during GetCapabilities request");

0 commit comments

Comments
 (0)
Please sign in to comment.