If I don't misread the docs, if a template is given, the file
is created in the current directory instead of the temporary
directory reported by QDir::tempPath()
Furthermore it cannot be set by env TMPDIR.
This issue drove me crazy (and no exceptions and no logs!)
until when I switched the server user to root (that is
of course not what we want).
As a temporary workaround, the server can be configured to
use /tmp or another www-data writeable directory as a working
directory.
By prefixing with tempPath() the file will be created
in the system temp directory.
* detect SIP version to add DefaultDocstringSignature directive
SIP doesn't handle any kind of preprocessing, so there's no better solution than configuring the SIP files from CMake.
SIP 4.19.7+ supports %DefaultDocstringSignature to prepend auto-generated Python signature to existing Docstrings
Run clang-tidy modernize-use-override to remove all the redundant
virtual keywords from overridden methods, and add some missing
overrides.
Another benefit is that this has also added the overrides
on destructors, which will cause a build failure if a base
class is missing a virtual destructor.
With this commit, it's posssible to handle a request from a QgsProject without writing it to the disk.
```python
server = QgsServer()
project = QgsProject()
vlayer = QgsVectorLayer("/path/to/shapefile/file.shp", "layer_name_you_like", "ogr")
project.addMapLayer(vlayer)
query_string = 'https://www.qgis.org/?SERVICE=WMS&VERSION=1.3&REQUEST=GetCapabilities'
request = QgsBufferServerRequest(query_string, QgsServerRequest.GetMethod, {}, data)
response = QgsBufferServerResponse()
server.handleRequest(request, response, project)
```
Previously this was only enabled for optional arguments (i.e.
those with default values). Enabling them for all arguments
allows for more readable PyQGIS code, and there seems no
downside given that we already have this support partly enabled.
The consequence of this change is that when 3.0 API is frozen
the freeze must also include the naming of function arguments,
since that's effectively now part of public API.
This removes the handleRequest method that returns the
headers and body as byte array.
This superceeded by the implementation that takes a
request and response instances.
This part adds the headers as an optional argument
to the request and start using the handleRequest(request, response)
call in the python tests.
Some additional tests are also added.
* Renamed returnCode to statusCode (as per RFC https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html)
* Expose statusCode to server iface
* API Break: Renamed getHeader() to header() Qt-style
* Split server plugin filter tests in its own test file
* Added tests for clearBody() and body() getter