summaryrefslogtreecommitdiff
path: root/lib/libfetch/http.c
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2001-05-27 11:00:36 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2001-05-27 11:00:36 +0000
commit6a0cf64bce349bbe8de9a76bdda1b7b31010cf86 (patch)
tree2052c90a75cbdc353ce4122adf670e98f044c065 /lib/libfetch/http.c
parent5ef824ed2b1eb2ada7900338d591d4937a6b8261 (diff)
Notes
Diffstat (limited to 'lib/libfetch/http.c')
-rw-r--r--lib/libfetch/http.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libfetch/http.c b/lib/libfetch/http.c
index 77c3a2d62cb1..5863c80b62cb 100644
--- a/lib/libfetch/http.c
+++ b/lib/libfetch/http.c
@@ -777,7 +777,10 @@ _http_request(struct url *URL, const char *op, struct url_stat *us,
}
/* other headers */
- _http_cmd(fd, "User-Agent: %s " _LIBFETCH_VER, __progname);
+ if ((p = getenv("HTTP_USER_AGENT")) != NULL && *p != '\0')
+ _http_cmd(fd, "User-Agent: %s", p);
+ else
+ _http_cmd(fd, "User-Agent: %s " _LIBFETCH_VER, __progname);
if (url->offset)
_http_cmd(fd, "Range: bytes=%lld-", url->offset);
_http_cmd(fd, "Connection: close");