Flip default to optional check.
authorScott Cantor <cantor.2@osu.edu>
Tue, 7 Nov 2006 01:30:15 +0000 (01:30 +0000)
committerScott Cantor <cantor.2@osu.edu>
Tue, 7 Nov 2006 01:30:15 +0000 (01:30 +0000)
saml/binding/MessageRoutingRule.h
saml/binding/impl/MessageRoutingRule.cpp

index cc30ea4..e38adc8 100644 (file)
@@ -33,6 +33,14 @@ namespace opensaml {
     class SAML_API MessageRoutingRule : public SecurityPolicyRule
     {
     public:
+        /**
+         * Constructor.
+         * 
+         * If an XML attribute named mandatory is set to "true" or "1", then
+         * a destination address <strong>MUST</strong> be present in the message.
+         * 
+         * @param e DOM tree to initialize rule
+         */
         MessageRoutingRule(const DOMElement* e);
         virtual ~MessageRoutingRule() {}
         
index 261edd1..60b297f 100644 (file)
@@ -45,12 +45,12 @@ namespace opensaml {
 
 static const XMLCh mandatory[] = UNICODE_LITERAL_9(m,a,n,d,a,t,o,r,y);
 
-MessageRoutingRule::MessageRoutingRule(const DOMElement* e) : m_mandatory(true)
+MessageRoutingRule::MessageRoutingRule(const DOMElement* e) : m_mandatory(false)
 {
     if (e) {
         const XMLCh* attr = e->getAttributeNS(NULL, mandatory);
-        if (attr && (*attr==chLatin_f || *attr==chDigit_0))
-            m_mandatory = false;
+        if (attr && (*attr==chLatin_t || *attr==chDigit_1))
+            m_mandatory = true;
     }
 }