Index: lib/libfetch/fetch.3 =================================================================== --- lib/libfetch/fetch.3 (revision 258921) +++ lib/libfetch/fetch.3 (working copy) @@ -627,6 +627,7 @@ the document URL will be used as referrer URL. Specifies the User-Agent string to use for HTTP requests. This can be useful when working with HTTP origin or proxy servers that differentiate between user agents. +If used with an empty string no User-Agent is sent. .It Ev NETRC Specifies a file to use instead of .Pa ~/.netrc Index: lib/libfetch/http.c =================================================================== --- lib/libfetch/http.c (revision 258921) +++ lib/libfetch/http.c (working copy) @@ -1679,9 +1679,10 @@ http_request(struct url *URL, const char *op, stru else http_cmd(conn, "Referer: %s", p); } - if ((p = getenv("HTTP_USER_AGENT")) != NULL && *p != '\0') - http_cmd(conn, "User-Agent: %s", p); - else + if ((p = getenv("HTTP_USER_AGENT")) != NULL) { + if (*p != '\0') + http_cmd(conn, "User-Agent: %s", p); + } else http_cmd(conn, "User-Agent: %s " _LIBFETCH_VER, getprogname()); if (url->offset > 0) http_cmd(conn, "Range: bytes=%lld-", (long long)url->offset);