Fix for bug 436
authorScott Cantor <cantor.2@osu.edu>
Mon, 2 Oct 2006 20:55:29 +0000 (20:55 +0000)
committerScott Cantor <cantor.2@osu.edu>
Mon, 2 Oct 2006 20:55:29 +0000 (20:55 +0000)
shib-target/shib-handlers.cpp

index 2616517..2f0d65d 100644 (file)
@@ -236,7 +236,9 @@ pair<bool,void*> SessionInitiator::ShibAuthnRequest(
     
     char timebuf[16];
     sprintf(timebuf,"%lu",time(NULL));
-    string req=string(dest) + "?shire=" + CgiParse::url_encode(ACSloc.c_str()) + "&time=" + timebuf;
+    string req=string(dest);
+    req += strchr(dest,'?') ? '&' : '?';
+    req = req + "shire=" + CgiParse::url_encode(ACSloc.c_str()) + "&time=" + timebuf;
 
     // How should the resource value be preserved?
     pair<bool,bool> localRelayState=st->getConfig()->getPropertySet("Local")->getBool("localRelayState");