added HTTPServerRequest::secure() method

This commit is contained in:
Guenter Obiltschnig 2015-06-02 20:51:33 +02:00
parent 3baf590485
commit 5b80826437
3 changed files with 19 additions and 0 deletions

View File

@ -71,6 +71,12 @@ public:
virtual HTTPServerResponse& response() const = 0;
/// Returns a reference to the associated response.
virtual bool secure() const = 0;
/// Returns true if the request is using a secure
/// connection. Returns false if no secure connection
/// is used, or if it is not known whether a secure
/// connection is used.
};

View File

@ -75,6 +75,12 @@ public:
HTTPServerResponse& response() const;
/// Returns a reference to the associated response.
bool secure() const;
/// Returns true if the request is using a secure
/// connection. Returns false if no secure connection
/// is used, or if it is not known whether a secure
/// connection is used.
StreamSocket& socket();
/// Returns a reference to the underlying socket.

View File

@ -22,6 +22,7 @@
#include "Poco/Net/HTTPFixedLengthStream.h"
#include "Poco/Net/HTTPChunkedStream.h"
#include "Poco/Net/HTTPServerParams.h"
#include "Poco/Net/StreamSocket.h"
#include "Poco/String.h"
@ -71,6 +72,12 @@ HTTPServerRequestImpl::~HTTPServerRequestImpl()
}
bool HTTPServerRequestImpl::secure() const
{
return _session.socket().secure();
}
StreamSocket& HTTPServerRequestImpl::socket()
{
return _session.socket();