Skip to content

Commit

Permalink
Update override comment with a full explanation of what it does
Browse files Browse the repository at this point in the history
Also checks for original url emptiness before returning it.
  • Loading branch information
elpaso committed Jan 10, 2019
1 parent cf5982c commit cd763bc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
8 changes: 5 additions & 3 deletions python/server/auto_generated/qgsfcgiserverrequest.sip.in
Expand Up @@ -38,9 +38,11 @@ Returns true if an error occurred during initialization

: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).
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


Expand Down
2 changes: 1 addition & 1 deletion src/server/qgsfcgiserverrequest.cpp
Expand Up @@ -135,7 +135,7 @@ QByteArray QgsFcgiServerRequest::data() const

QUrl QgsFcgiServerRequest::url() const
{
return mOriginalUrl;
return mOriginalUrl.isEmpty() ? QgsServerRequest::url() : mOriginalUrl;
}

// Read post put data
Expand Down
8 changes: 5 additions & 3 deletions src/server/qgsfcgiserverrequest.h
Expand Up @@ -45,9 +45,11 @@ class SERVER_EXPORT QgsFcgiServerRequest: public QgsServerRequest
/**
* \returns 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).
* 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.
*/
QUrl url() const override;

Expand Down

0 comments on commit cd763bc

Please sign in to comment.