Skip to content

Commit 8bd78b3

Browse files
committed
Working implementation
Funded by ItOpen - http://www.itopen.it
1 parent 856e4de commit 8bd78b3

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/mapserver/qgshttprequesthandler.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff 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

src/mapserver/qgsrequesthandler.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff 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;

0 commit comments

Comments
 (0)