X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fopensaml2.git;a=blobdiff_plain;f=saml%2Fsaml2%2Fbinding%2Fimpl%2FSAML2POSTDecoder.cpp;h=988aa0f15f2b1e47af217ad5a1cdd8df548a5995;hp=692950b87feccd0dae4f8ea2a3fa2568e62ec0a9;hb=98b9be4dacac1d9a8729906473e35fc904676d12;hpb=51425e46e07cbee4c4536635daf3b807d3336f11 diff --git a/saml/saml2/binding/impl/SAML2POSTDecoder.cpp b/saml/saml2/binding/impl/SAML2POSTDecoder.cpp index 692950b..988aa0f 100644 --- 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(&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")) - 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) - return NULL; + throw BindingException("Request missing SAMLRequest or SAMLResponse parameter."); const char* state = httpRequest->getParameter("RelayState"); if (state) relayState = state;