https://issues.shibboleth.net/jira/browse/CPPOST-61
authorScott Cantor <cantor.2@osu.edu>
Sat, 15 Jan 2011 20:08:35 +0000 (20:08 +0000)
committerScott Cantor <cantor.2@osu.edu>
Sat, 15 Jan 2011 20:08:35 +0000 (20:08 +0000)
saml/saml2/binding/impl/SAML2RedirectEncoder.cpp

index 616d98f..bb28484 100644 (file)
@@ -138,15 +138,18 @@ long SAML2RedirectEncoder::encode(
         throw BindingException("Base64 encoding of XML failed.");
     
     // Create beginnings of redirect query string.
-    const URLEncoder* escaper = XMLToolingConfig::getConfig().getURLEncoder();
     xmlbuf.erase();
-    xmlbuf.append(reinterpret_cast<char*>(encoded), xlen);
+    for (const XMLByte* xb = encoded; *xb; ++xb) {
+        if (!isspace(*xb))
+            xmlbuf += *xb;
+    }
 #ifdef OPENSAML_XERCESC_HAS_XMLBYTE_RELEASE
     XMLString::release(&encoded);
 #else
     XMLString::release((char**)&encoded);
 #endif
     
+    const URLEncoder* escaper = XMLToolingConfig::getConfig().getURLEncoder();
     xmlbuf = (request ? "SAMLRequest=" : "SAMLResponse=") + escaper->encode(xmlbuf.c_str()); 
     if (relayState && *relayState)
         xmlbuf = xmlbuf + "&RelayState=" + escaper->encode(relayState);