Skip to content
Permalink
Browse files

Merge pull request #9806 from qgis/backport-9791-to-release-3_4

[Backport release-3_4] [Backport release-3_6][server] Fallback to unmanaged parameters
  • Loading branch information
rldhont committed Apr 18, 2019
2 parents d673c6f + 734565b commit 960e10db8fb660f08e4950d6760a6b06029392f1
Showing with 14 additions and 1 deletion.
  1. +8 −1 src/server/qgsserverparameters.cpp
  2. +6 −0 tests/src/python/test_qgsserver_request.py
@@ -519,7 +519,14 @@ QString QgsServerParameters::request() const

QString QgsServerParameters::value( const QString &key ) const
{
return value( QgsServerParameter::name( key ) ).toString();
if ( ! mParameters.contains( QgsServerParameter::name( key ) ) )
{
return mUnmanagedParameters[key];
}
else
{
return value( QgsServerParameter::name( key ) ).toString();
}
}

QVariant QgsServerParameters::value( QgsServerParameter::Name name ) const
@@ -196,6 +196,12 @@ def _check_links(params, method='GET'):
_check_links(params)
_check_links(params, 'POST')

def test_add_parameters(self):
request = QgsServerRequest()
request.setParameter('FOOBAR', 'foobar')
self.assertEqual(request.parameter('FOOBAR'), 'foobar')
self.assertEqual(request.parameter('UNKNOWN'), '')


if __name__ == '__main__':
unittest.main()

0 comments on commit 960e10d

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