projects
/
shibboleth
/
opensaml2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Always throw a descriptive exception instead of returning nothing.
[shibboleth/opensaml2.git]
/
saml
/
saml2
/
binding
/
impl
/
SAML2POSTDecoder.cpp
diff --git
a/saml/saml2/binding/impl/SAML2POSTDecoder.cpp
b/saml/saml2/binding/impl/SAML2POSTDecoder.cpp
index
692950b
..
988aa0f
100644
(file)
--- a/
saml/saml2/binding/impl/SAML2POSTDecoder.cpp
+++ b/
saml/saml2/binding/impl/SAML2POSTDecoder.cpp
@@
-76,17
+76,15
@@
XMLObject* SAML2POSTDecoder::decode(
log.debug("validating input");
const HTTPRequest* httpRequest=dynamic_cast<const HTTPRequest*>(&genericRequest);
log.debug("validating input");
const HTTPRequest* httpRequest=dynamic_cast<const HTTPRequest*>(&genericRequest);
- if (!httpRequest) {
- log.error("unable to cast request to HTTPRequest type");
- return NULL;
- }
+ if (!httpRequest)
+ throw BindingException("Unable to cast request object to HTTPRequest type.");
if (strcmp(httpRequest->getMethod(),"POST"))
if (strcmp(httpRequest->getMethod(),"POST"))
-
return NULL
;
+
throw BindingException("Invalid HTTP method ($1).", params(1, httpRequest->getMethod()))
;
const char* msg = httpRequest->getParameter("SAMLResponse");
if (!msg)
msg = httpRequest->getParameter("SAMLRequest");
if (!msg)
const char* msg = httpRequest->getParameter("SAMLResponse");
if (!msg)
msg = httpRequest->getParameter("SAMLRequest");
if (!msg)
-
return NULL
;
+
throw BindingException("Request missing SAMLRequest or SAMLResponse parameter.")
;
const char* state = httpRequest->getParameter("RelayState");
if (state)
relayState = state;
const char* state = httpRequest->getParameter("RelayState");
if (state)
relayState = state;