X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Furl.c;h=1c55261dd4aa15eac9b4ccd6f336b1efcb7220d6;hp=3c2b361b75a3d31c6bd8cf1be6a2415178b68413;hb=a17e9df75e5d75ccdc3f19101fb7b5d0c5a75e46;hpb=6e0314cce5d9c3d346d4d968a7ea07f92d8761b1 diff --git a/src/url.c b/src/url.c index 3c2b361..1c55261 100644 --- a/src/url.c +++ b/src/url.c @@ -112,6 +112,11 @@ Z_HTTP_Response *yaz_url_exec(yaz_url_t p, const char *uri, gdu = z_get_HTTP_Request_uri(p->odr_out, uri_lean, 0, p->proxy ? 1 : 0); gdu->u.HTTP_Request->method = odr_strdup(p->odr_out, method); + /* clear all headers - including "User-Agent", if already in headers + z_get_HTTP_Request_uri sets "User-Agent" header */ + if (z_HTTP_header_lookup(headers, "User-Agent")) + gdu->u.HTTP_Request->headers = 0; + if (http_user && http_pass) z_HTTP_header_add_basic_auth(p->odr_out, &gdu->u.HTTP_Request->headers,