File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -401,6 +401,10 @@ void QgsHttpRequestHandler::setServiceException( QgsMapServiceException ex )
401401 serviceExceptionReportElem.appendChild ( serviceExceptionElem );
402402
403403 QByteArray ba = exceptionDoc.toByteArray ();
404+ // Clear response headers and body and set new exception
405+ // TODO: check for headersSent()
406+ clearHeaders ();
407+ clearBody ();
404408 setHttpResponse ( &ba, " text/xml" );
405409}
406410
Original file line number Diff line number Diff line change @@ -75,14 +75,21 @@ class QgsRequestHandler
7575 virtual int removeParameter ( const QString &key ) = 0;
7676 /* *Return a request parameter*/
7777 virtual QString parameter ( const QString &key ) const = 0;
78+ /* *Return the response body*/
79+ virtual QByteArray* body ( ) { return &mBody ; }
80+ /* *Return the requested format string*/
7881 QString format () const { return mFormat ; }
82+ /* *Return the mime type for the response*/
83+ QString infoFormat () const { return mInfoFormat ; }
84+ /* *Return true if the HTTP headers were already sent to the client*/
7985 bool headersSent () { return mHeadersSent ; }
8086 QString infoFormat () const { return mInfoFormat ; }
8187
8288 protected:
8389
8490 virtual void sendHeaders ( ) = 0;
8591 virtual void sendBody ( ) const = 0;
92+ QByteArray mBody ; // The response payload
8693 /* *This is set by the parseInput methods of the subclasses (parameter FORMAT, e.g. 'FORMAT=PNG')*/
8794 QByteArray mBody ; // The response payload
8895 QString mFormat ;
You can’t perform that action at this time.
0 commit comments