Pass-through x-username and omitted password to Z39.50 target.
authorAdam Dickmeiss <adam@indexdata.dk>
Tue, 17 Mar 2009 15:05:55 +0000 (16:05 +0100)
committerAdam Dickmeiss <adam@indexdata.dk>
Tue, 17 Mar 2009 15:05:55 +0000 (16:05 +0100)
src/yaz-proxy.cpp

index 1d6e22c..814c0f8 100644 (file)
@@ -2819,7 +2819,14 @@ void Yaz_Proxy::handle_incoming_HTTP(Z_HTTP_Request *hreq)
         m_s2z_stylesheet = 0;
         
         Z_IdAuthentication *auth = NULL;
-        if (srw_pdu->username && srw_pdu->password)
+        if (srw_pdu->username && !srw_pdu->password)
+        {
+            yaz_log(YLOG_LOG, "username: %s\n", srw_pdu->username);
+            auth = (Z_IdAuthentication *) odr_malloc(m_s2z_odr_init, sizeof(Z_IdAuthentication));
+            auth->which = Z_IdAuthentication_open;
+            auth->u.open = odr_strdup(m_s2z_odr_init, srw_pdu->username);
+        }
+        else if (srw_pdu->username && srw_pdu->password)
         {
             yaz_log(YLOG_LOG, "username/password: %s/%s\n",
                     srw_pdu->username, srw_pdu->password);