From a17e9df75e5d75ccdc3f19101fb7b5d0c5a75e46 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 1 May 2013 14:05:32 +0200 Subject: [PATCH] yaz_url_exec: only one User-Agent User-Agent in headers removes the default User-Agent: YAZ . --- src/url.c | 5 +++++ 1 file changed, 5 insertions(+) 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, -- 1.7.10.4