diff options
Diffstat (limited to 'lib/libfetch/http.c')
-rw-r--r-- | lib/libfetch/http.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libfetch/http.c b/lib/libfetch/http.c index 77c3a2d..5863c80 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"); |