Skip to content

Commit 339d800

Browse files
committedAug 26, 2011
Add non-default port numbers to GetMap and GetFeatureInfo urls
1 parent 0d688d4 commit 339d800

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
 

‎src/mapserver/qgswmsserver.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,22 @@ QDomDocument QgsWMSServer::getCapabilities()
110110
QString requestUrl = getenv( "REQUEST_URI" );
111111
QUrl mapUrl( requestUrl );
112112
mapUrl.setHost( QString( getenv( "SERVER_NAME" ) ) );
113+
114+
//Add non-default ports to url
115+
QString portString = getenv( "SERVER_PORT" );
116+
if ( !portString.isEmpty() )
117+
{
118+
bool portOk;
119+
int portNumber = portString.toInt( &portOk );
120+
if ( portOk )
121+
{
122+
if ( portNumber != 80 )
123+
{
124+
mapUrl.setPort( portNumber );
125+
}
126+
}
127+
}
128+
113129
if ( QString( getenv( "HTTPS" ) ).compare( "on", Qt::CaseInsensitive ) == 0 )
114130
{
115131
mapUrl.setScheme( "https" );

0 commit comments

Comments
 (0)
Please sign in to comment.