Changed ENV exporting of multi-valued attributes to use : as the separator. Added...
authorWalter Hoehn <wassa@memphis.edu>
Wed, 16 Oct 2002 02:58:45 +0000 (02:58 +0000)
committerWalter Hoehn <wassa@memphis.edu>
Wed, 16 Oct 2002 02:58:45 +0000 (02:58 +0000)
mod_shibrm/mod_shibrm.cpp

index fed688b..7328a45 100644 (file)
@@ -427,10 +427,20 @@ extern "C" int shibrm_check_auth(request_rec* r)
          r->connection->user=ap_pstrdup(r->connection->pool,vals.next().c_str());
        else
        {
-         char* header=ap_pstrdup(r->pool," ");
-         while (vals.hasNext())
-           header=ap_pstrcat(r->pool,header,vals.next().c_str()," ",NULL);
-         ap_table_setn(r->headers_in,hname.c_str(),header);
+        char* header = ap_pstrdup(r->pool, "");
+        for (int it = 0; vals.hasNext(); it++) {
+               string value = vals.next();
+               for (string::size_type pos = value.find_first_of(":", string::size_type(0)); pos != string::npos; pos = value.find_first_of(":", pos)) {
+                       value.insert(pos, "\\");
+                       pos += 2;
+               }
+               if (it == 0) {
+                       header=ap_pstrcat(r->pool, value.c_str(), NULL);
+               } else {
+                       header=ap_pstrcat(r->pool, header, ":", value.c_str(), NULL);
+               }
+        }
+        ap_table_setn(r->headers_in, hname.c_str(), header);
        }
       }
     }