-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8830 from elpaso/bugfix-server-fcgi-rewritten-uri
[server] Use REQUEST_URI as default URL for FCGI requests
- Loading branch information
Showing
7 changed files
with
162 additions
and
55 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,57 @@ | ||
/************************************************************************ | ||
* 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 | ||
|
||
Overrides base implementation because FCGI is typically behind | ||
a proxy server and QGIS Server will see a rewritten QUERY_STRING. | ||
FCGI implementation stores the REQUEST_URI (which is the URL seen | ||
by the proxy before it gets rewritten) and returns it instead of | ||
the rewritten one. | ||
%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
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
dedbbd4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately this seems to break the server in cases where a POST is used to transmit the query parameters. In this case QgsServerRequest analyzes the posted parameters and appends them to the original url so the server services can build QgsWmsParameters, QgsWfsParameters etc. from the query string. With the overriden url() getter in QgsFcgiServerRequest the original url is returned to the services which in a POST scenario has no query resulting in the services (at least in their current implementation) to not be able to get the posted parameters.