Skip to content

Commit 4e7efd6

Browse files
committed
Set content disposition header earlier, otherwise the streaming servers don't get it
1 parent ce2c402 commit 4e7efd6

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/server/qgsserver.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,14 @@ QByteArray QgsServer::handleRequest( const QString queryString ,
528528
}
529529
}
530530

531+
//possibility for client to suggest a download filename
532+
QString outputFileName = theRequestHandler->parameter( "FILE_NAME" );
533+
if ( !outputFileName.isEmpty() )
534+
{
535+
theRequestHandler->setDefaultHeaders();
536+
theRequestHandler->setHeader( "Content-Disposition", "attachment; filename=\"" + outputFileName + "\"" );
537+
}
538+
531539
// Enter core services main switch
532540
if ( !theRequestHandler->exceptionRaised() )
533541
{
@@ -584,14 +592,6 @@ QByteArray QgsServer::handleRequest( const QString queryString ,
584592
}
585593
#endif
586594

587-
//possibility for client to suggest a download filename
588-
QString outputFileName = theRequestHandler->parameter( "FILE_NAME" );
589-
if ( !outputFileName.isEmpty() )
590-
{
591-
theRequestHandler->setDefaultHeaders();
592-
theRequestHandler->setHeader( "Content-Disposition", "attachment; filename=\"" + outputFileName + "\"" );
593-
}
594-
595595
theRequestHandler->sendResponse();
596596

597597
if ( logLevel < 1 )

0 commit comments

Comments
 (0)