Skip to content
Permalink
Browse files

Set content disposition header earlier, otherwise the streaming serve…

…rs don't get it
  • Loading branch information
mhugent committed Jul 8, 2015
1 parent ce2c402 commit 4e7efd669de21f58adcf32be21df4ac510a67c3a
Showing with 8 additions and 8 deletions.
  1. +8 −8 src/server/qgsserver.cpp
@@ -528,6 +528,14 @@ QByteArray QgsServer::handleRequest( const QString queryString ,
}
}

//possibility for client to suggest a download filename
QString outputFileName = theRequestHandler->parameter( "FILE_NAME" );
if ( !outputFileName.isEmpty() )
{
theRequestHandler->setDefaultHeaders();
theRequestHandler->setHeader( "Content-Disposition", "attachment; filename=\"" + outputFileName + "\"" );
}

// Enter core services main switch
if ( !theRequestHandler->exceptionRaised() )
{
@@ -584,14 +592,6 @@ QByteArray QgsServer::handleRequest( const QString queryString ,
}
#endif

//possibility for client to suggest a download filename
QString outputFileName = theRequestHandler->parameter( "FILE_NAME" );
if ( !outputFileName.isEmpty() )
{
theRequestHandler->setDefaultHeaders();
theRequestHandler->setHeader( "Content-Disposition", "attachment; filename=\"" + outputFileName + "\"" );
}

theRequestHandler->sendResponse();

if ( logLevel < 1 )

0 comments on commit 4e7efd6

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