Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 4e7efd6
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/server/qgsserver.cpp
Expand Up @@ -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() )
{
Expand Down Expand Up @@ -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 )
Expand Down

0 comments on commit 4e7efd6

Please sign in to comment.