Fix check for message type.
authorcantor <cantor@fb386ef7-a10c-0410-8ebf-fd3f8e989ab0>
Thu, 5 Oct 2006 22:27:46 +0000 (22:27 +0000)
committercantor <cantor@fb386ef7-a10c-0410-8ebf-fd3f8e989ab0>
Thu, 5 Oct 2006 22:27:46 +0000 (22:27 +0000)
git-svn-id: https://svn.middleware.georgetown.edu/cpp-opensaml2/trunk@95 fb386ef7-a10c-0410-8ebf-fd3f8e989ab0

saml/saml2/binding/impl/SAML2POSTEncoder.cpp

index 9dace84..72d6ba8 100644 (file)
@@ -70,10 +70,11 @@ void SAML2POSTEncoder::encode(
     
     StatusResponseType* response = NULL;
     RequestAbstractType* request = dynamic_cast<RequestAbstractType*>(xmlObject);
-    if (!request)
+    if (!request) {
         response = dynamic_cast<StatusResponseType*>(xmlObject);
-    if (!response)
-        throw BindingException("XML content for SAML 2.0 HTTP-POST Encoder must be a SAML 2.0 protocol message.");
+        if (!response)
+            throw BindingException("XML content for SAML 2.0 HTTP-POST Encoder must be a SAML 2.0 protocol message.");
+    }
     
     DOMElement* rootElement = NULL;
     if (credResolver) {