Skip to content

Commit c54299d

Browse files
authoredOct 27, 2017
Merge pull request #5406 from pblottiere/bugfix_server_hex
[server][bugfix] Fix parameter decoding with post method and urlencoded
2 parents 6829a92 + 8562bfa commit c54299d

File tree

3 files changed

+43
-1
lines changed

3 files changed

+43
-1
lines changed
 

‎src/server/qgsrequesthandler.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,8 @@ void QgsRequestHandler::parseInput()
230230
QList<pair_t> items = query.queryItems();
231231
Q_FOREACH ( const pair_t &pair, items )
232232
{
233-
mRequest.setParameter( pair.first.toUpper(), pair.second );
233+
const QString value = QUrl::fromPercentEncoding( pair.second.toUtf8() );
234+
mRequest.setParameter( pair.first.toUpper(), value );
234235
}
235236
setupParameters();
236237
}

‎tests/src/python/test_qgsserver_wms.py

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,6 +1407,47 @@ def test_wms_getprint_selection(self):
14071407
r, h = self._result(self._execute_request(qs))
14081408
self._img_diff_error(r, h, "WMS_GetPrint_Selection")
14091409

1410+
def test_wms_getprint_opacity(self):
1411+
qs = "?" + "&".join(["%s=%s" % i for i in list({
1412+
"MAP": urllib.parse.quote(self.projectPath),
1413+
"SERVICE": "WMS",
1414+
"VERSION": "1.1.1",
1415+
"REQUEST": "GetPrint",
1416+
"TEMPLATE": "layoutA4",
1417+
"FORMAT": "png",
1418+
"map0:EXTENT": "-33626185.498,-13032965.185,33978427.737,16020257.031",
1419+
"map0:LAYERS": "Country,Hello",
1420+
"HEIGHT": "500",
1421+
"WIDTH": "500",
1422+
"CRS": "EPSG:3857",
1423+
"SELECTION": "Country: 4",
1424+
"LAYERS": "Country,Hello",
1425+
"OPACITIES": "125,125"
1426+
}.items())])
1427+
1428+
r, h = self._result(self._execute_request(qs))
1429+
self._img_diff_error(r, h, "WMS_GetPrint_Opacity")
1430+
1431+
qs = "?" + "&".join(["%s=%s" % i for i in list({
1432+
"MAP": urllib.parse.quote(self.projectPath),
1433+
"SERVICE": "WMS",
1434+
"VERSION": "1.1.1",
1435+
"REQUEST": "GetPrint",
1436+
"TEMPLATE": "layoutA4",
1437+
"FORMAT": "png",
1438+
"map0:EXTENT": "-33626185.498,-13032965.185,33978427.737,16020257.031",
1439+
"map0:LAYERS": "Country,Hello",
1440+
"HEIGHT": "500",
1441+
"WIDTH": "500",
1442+
"CRS": "EPSG:3857",
1443+
"SELECTION": "Country: 4",
1444+
"LAYERS": "Country,Hello",
1445+
"OPACITIES": "125%2C125"
1446+
}.items())])
1447+
1448+
r, h = self._result(self._execute_request(qs))
1449+
self._img_diff_error(r, h, "WMS_GetPrint_Opacity")
1450+
14101451
def test_wms_getprint_highlight(self):
14111452
# default style
14121453
qs = "?" + "&".join(["%s=%s" % i for i in list({
Loading

0 commit comments

Comments
 (0)
Please sign in to comment.