From: Scott Cantor Date: Wed, 10 Jan 2007 05:20:34 +0000 (+0000) Subject: Add some addtl methods. X-Git-Tag: 2.0-alpha1~115 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fcpp-opensaml.git;a=commitdiff_plain;h=0a8bf8e0bdad5f92ec90f3f5d9bd73c82fb41fe8 Add some addtl methods. --- diff --git a/saml/binding/GenericRequest.h b/saml/binding/GenericRequest.h index 0acfd4d..df0c005 100644 --- a/saml/binding/GenericRequest.h +++ b/saml/binding/GenericRequest.h @@ -58,6 +58,20 @@ namespace opensaml { virtual bool isSecure() const=0; /** + * Returns hostname of service that received request. + * + * @return hostname of service + */ + virtual const char* getHostname() const=0; + + /** + * Returns incoming port. + * + * @return incoming port + */ + virtual int getPort() const=0; + + /** * Returns the MIME type of the request, if known. * * @return the MIME type, or an empty string diff --git a/saml/binding/HTTPRequest.h b/saml/binding/HTTPRequest.h index 2c34a83..5f17c1d 100644 --- a/saml/binding/HTTPRequest.h +++ b/saml/binding/HTTPRequest.h @@ -51,12 +51,19 @@ namespace opensaml { virtual const char* getMethod() const=0; /** - * Returns the complete request URL, including scheme, host, port. + * Returns the request URI. + * + * @return the request URI + */ + virtual const char* getRequestURI() const=0; + + /** + * Returns the complete request URL, including scheme, host, port, and URI. * * @return the request URL */ virtual const char* getRequestURL() const=0; - + /** * Returns the HTTP query string appened to the request. The query * string is returned without any decoding applied, everything found diff --git a/samltest/binding.h b/samltest/binding.h index 2947a49..fdbe990 100644 --- a/samltest/binding.h +++ b/samltest/binding.h @@ -130,6 +130,14 @@ public: return true; } + const char* getHostname() const { + return "localhost"; + } + + int getPort() const { + return 443; + } + string getContentType() const { return "application/x-www-form-urlencoded"; } @@ -138,6 +146,10 @@ public: return -1; } + const char* getRequestURI() const { + return "/"; + } + const char* getRequestURL() const { return m_url.c_str(); }