X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fcpp-opensaml.git;a=blobdiff_plain;f=saml%2Fsaml1%2Fbinding%2Fimpl%2FSAML1POSTDecoder.cpp;h=ef39d628967da4e92ed8c0a84a074854a033920f;hp=bf3395e3d6da9a7f0ead00a6b5dc9da279440d2d;hb=1c199e2d851bf77015ce0b1d80ac2cc6ef60cda3;hpb=b1a9d73e4cd13aa99f221b8e7a38dcb92931a1f1 diff --git a/saml/saml1/binding/impl/SAML1POSTDecoder.cpp b/saml/saml1/binding/impl/SAML1POSTDecoder.cpp index bf3395e..ef39d62 100644 --- a/saml/saml1/binding/impl/SAML1POSTDecoder.cpp +++ b/saml/saml1/binding/impl/SAML1POSTDecoder.cpp @@ -77,16 +77,14 @@ XMLObject* SAML1POSTDecoder::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* samlResponse = httpRequest->getParameter("SAMLResponse"); const char* TARGET = httpRequest->getParameter("TARGET"); if (!samlResponse || !TARGET) - return NULL; + throw BindingException("Request missing SAMLResponse or TARGET parameters."); relayState = TARGET; // Decode the base64 into SAML.