z_HTTP_header_add_basic_auth uses z_HTTP_header_set
authorAdam Dickmeiss <adam@indexdata.dk>
Mon, 6 May 2013 10:26:25 +0000 (12:26 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Mon, 6 May 2013 10:26:25 +0000 (12:26 +0200)
rather than z_HTTP_header_add, to avoid having two Authorization
headers by mistake.

src/http.c

index 62bfa6f..6f53119 100644 (file)
@@ -191,7 +191,7 @@ void z_HTTP_header_add_basic_auth(ODR o, Z_HTTP_Header **hp,
     buf = (char *) odr_malloc(o, (len+1) * 8/6 + 12);
     strcpy(buf, "Basic ");
     yaz_base64encode(tmp, &buf[strlen(buf)]);
-    z_HTTP_header_add(o, hp, "Authorization", buf);
+    z_HTTP_header_set(o, hp, "Authorization", buf);
 }