Skip to content
Permalink
Browse files

Working implementation

Funded by ItOpen - http://www.itopen.it
  • Loading branch information
elpaso committed Nov 5, 2014
1 parent 856e4de commit 8bd78b3386efed9e700b1860969238079468e7da
Showing with 11 additions and 0 deletions.
  1. +4 −0 src/mapserver/qgshttprequesthandler.cpp
  2. +7 −0 src/mapserver/qgsrequesthandler.h
@@ -401,6 +401,10 @@ void QgsHttpRequestHandler::setServiceException( QgsMapServiceException ex )
serviceExceptionReportElem.appendChild( serviceExceptionElem );

QByteArray ba = exceptionDoc.toByteArray();
// Clear response headers and body and set new exception
// TODO: check for headersSent()
clearHeaders();
clearBody();
setHttpResponse( &ba, "text/xml" );
}

@@ -75,14 +75,21 @@ class QgsRequestHandler
virtual int removeParameter( const QString &key ) = 0;
/**Return a request parameter*/
virtual QString parameter( const QString &key ) const = 0;
/**Return the response body*/
virtual QByteArray* body( ) { return &mBody; }
/**Return the requested format string*/
QString format() const { return mFormat; }
/**Return the mime type for the response*/
QString infoFormat() const { return mInfoFormat; }
/**Return true if the HTTP headers were already sent to the client*/
bool headersSent() { return mHeadersSent; }
QString infoFormat() const { return mInfoFormat; }

protected:

virtual void sendHeaders( ) = 0;
virtual void sendBody( ) const = 0;
QByteArray mBody; // The response payload
/**This is set by the parseInput methods of the subclasses (parameter FORMAT, e.g. 'FORMAT=PNG')*/
QByteArray mBody; // The response payload
QString mFormat;

0 comments on commit 8bd78b3

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