Skip to content
Permalink
Browse files

Port wmsserver changes to service

  • Loading branch information
dmarteau committed Jan 10, 2017
1 parent d8a05cc commit 4a7692998ee3b8ef6f78bb18235d83373551b14e
@@ -180,38 +180,38 @@ QgsFcgiServerRequest::QgsFcgiServerRequest()
QString uri = getenv( "REQUEST_URI" );
if ( uri.isEmpty() )
{
uri = getenv( "SCRIPT_NAME");
uri = getenv( "SCRIPT_NAME" );
}

url.setUrl( uri );

// Check if host is defined
if( url.host().isEmpty() )
if ( url.host().isEmpty() )
{
url.setHost( getenv( "SERVER_NAME" ) );
url.setHost( getenv( "SERVER_NAME" ) );
}

// Port ?
if( url.port(-1) == -1 )
if ( url.port( -1 ) == -1 )
{
QString portString = getenv( "SERVER_PORT" );
if ( !portString.isEmpty() )
QString portString = getenv( "SERVER_PORT" );
if ( !portString.isEmpty() )
{
bool portOk;
int portNumber = portString.toInt( &portOk );
if ( portOk && portNumber != 80 )
{
bool portOk;
int portNumber = portString.toInt( &portOk );
if ( portOk && portNumber != 80 )
{
url.setPort( portNumber );
}
url.setPort( portNumber );
}
}
}

// scheme
if( url.scheme().isEmpty() )
if ( url.scheme().isEmpty() )
{
QString( getenv( "HTTPS" ) ).compare( QLatin1String( "on" ), Qt::CaseInsensitive ) == 0
? url.setScheme( QStringLiteral( "https" ) )
: url.setScheme( QStringLiteral( "http" ) );
? url.setScheme( QStringLiteral( "https" ) )
: url.setScheme( QStringLiteral( "http" ) );
}

// XXX OGC paremetrs are passed with the query string
@@ -21,8 +21,8 @@
#include "qgsfilterresponsedecorator.h"

QgsFilterResponseDecorator::QgsFilterResponseDecorator( QgsServerFiltersMap filters, QgsServerResponse& response )
: mFilters(filters)
, mResponse(response)
: mFilters( filters )
, mResponse( response )
{
}

@@ -41,7 +41,7 @@ class QgsFilterResponseDecorator: public QgsServerResponse

// QgsServerResponse overrides

void setHeader( const QString& key, const QString& value ) override { mResponse.setHeader(key, value); }
void setHeader( const QString& key, const QString& value ) override { mResponse.setHeader( key, value ); }

void clearHeader( const QString& key ) override { mResponse.clearHeader( key ); }

@@ -51,7 +51,7 @@ class QgsFilterResponseDecorator: public QgsServerResponse

bool headersWritten() const override { return mResponse.headersWritten(); }

void setReturnCode( int code ) override { mResponse.setReturnCode( code ); }
void setReturnCode( int code ) override { mResponse.setReturnCode( code ); }

void sendError( int code, const QString& message ) override { mResponse.sendError( code, message ); }

@@ -62,8 +62,8 @@ class QgsFilterResponseDecorator: public QgsServerResponse
void flush() override;

void clear() override { mResponse.clear(); }



private:
QgsServerFiltersMap mFilters;

0 comments on commit 4a76929

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