X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fcpp-opensaml.git;a=blobdiff_plain;f=saml%2Fsaml2%2Fbinding%2Fimpl%2FSAML2ArtifactEncoder.cpp;h=80626f5ed39560771bfe997d8d6b39cdab52efd7;hp=7c4d16fc6b43302cb6d61e51969cad7001b49c3e;hb=54b7006826fd06e8e2bc251aaba38cccc85b3936;hpb=8d6e223c9b419991da694159e3dd5febf5e62dcc diff --git a/saml/saml2/binding/impl/SAML2ArtifactEncoder.cpp b/saml/saml2/binding/impl/SAML2ArtifactEncoder.cpp index 7c4d16f..80626f5 100644 --- a/saml/saml2/binding/impl/SAML2ArtifactEncoder.cpp +++ b/saml/saml2/binding/impl/SAML2ArtifactEncoder.cpp @@ -114,14 +114,14 @@ long SAML2ArtifactEncoder::encode( xmltooling::NDC ndc("encode"); #endif Category& log = Category::getInstance(SAML_LOGCAT".MessageEncoder.SAML2Artifact"); - log.debug("validating input"); + if (!destination) + throw BindingException("Encoding response requires a destination."); HTTPResponse* httpResponse=dynamic_cast(&genericResponse); if (!httpResponse) throw BindingException("Unable to cast response interface to HTTPResponse type."); if (relayState && strlen(relayState)>80) throw BindingException("RelayState cannot exceed 80 bytes in length."); - if (xmlObject->getParent()) throw BindingException("Cannot encode XML content with parent."); @@ -193,6 +193,7 @@ long SAML2ArtifactEncoder::encode( TemplateEngine* engine = XMLToolingConfig::getConfig().getTemplateEngine(); if (!engine) throw BindingException("Encoding artifact using POST requires a TemplateEngine instance."); + HTTPResponse::sanitizeURL(destination); ifstream infile(m_template.c_str()); if (!infile) throw BindingException("Failed to open HTML template for POST response ($1).", params(1,m_template.c_str()));