X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fcpp-opensaml.git;a=blobdiff_plain;f=saml%2Fsaml1%2Fbinding%2Fimpl%2FSAML1POSTEncoder.cpp;h=94b7f1671395daafb57a0f36489d86035e9e1a02;hp=89fa3e997c04725e736af599dac0d2ad0010c6d2;hb=54b7006826fd06e8e2bc251aaba38cccc85b3936;hpb=8d6e223c9b419991da694159e3dd5febf5e62dcc diff --git a/saml/saml1/binding/impl/SAML1POSTEncoder.cpp b/saml/saml1/binding/impl/SAML1POSTEncoder.cpp index 89fa3e9..94b7f16 100644 --- a/saml/saml1/binding/impl/SAML1POSTEncoder.cpp +++ b/saml/saml1/binding/impl/SAML1POSTEncoder.cpp @@ -108,12 +108,12 @@ long SAML1POSTEncoder::encode( xmltooling::NDC ndc("encode"); #endif Category& log = Category::getInstance(SAML_LOGCAT".MessageEncoder.SAML1POST"); + log.debug("validating input"); TemplateEngine* engine = XMLToolingConfig::getConfig().getTemplateEngine(); - if (!engine) - throw BindingException("Encoding response using POST requires a TemplateEngine instance."); - - log.debug("validating input"); + if (!engine || !destination) + throw BindingException("Encoding response using POST requires a TemplateEngine instance and a destination."); + HTTPResponse::sanitizeURL(destination); if (xmlObject->getParent()) throw BindingException("Cannot encode XML content with parent."); Response* response = dynamic_cast(xmlObject);