Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[server] Fix URL rewrite from fcgi servers
The URL exposed in the XML documents generated by the server was wrong because instead of using the original URL (from REQUEST_URI) the rewritten query string (from QUERY_STRING) was applied to the internal mUrl variable. This patch also adds some tests for the FCGI request, that handle most common scenarios with bot rewritten and not rewritten URLs. QgsFcgiServerRequest is now exposed to Python mainly for testability purposes.
- Loading branch information
Showing
6 changed files
with
114 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/server/qgsfcgiserverrequest.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ | ||
|
||
|
||
|
||
|
||
|
||
class QgsFcgiServerRequest: QgsServerRequest | ||
{ | ||
%Docstring | ||
Class defining fcgi request | ||
|
||
.. versionadded:: 3.0 | ||
%End | ||
|
||
%TypeHeaderCode | ||
#include "qgsfcgiserverrequest.h" | ||
%End | ||
public: | ||
QgsFcgiServerRequest(); | ||
|
||
virtual QByteArray data() const; | ||
|
||
|
||
bool hasError() const; | ||
%Docstring | ||
Returns true if an error occurred during initialization | ||
%End | ||
|
||
virtual QUrl url() const; | ||
|
||
%Docstring | ||
|
||
:return: the request url | ||
|
||
Subclasses may override in case the original URL needs to be | ||
returned instead of the rewritten one (i.e. from a web server | ||
rewrite module). | ||
%End | ||
|
||
|
||
}; | ||
|
||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/server/qgsfcgiserverrequest.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters