View | Details | Raw Unified | Return to bug 184507
Collapse All | Expand All

(-)lib/libfetch/fetch.3 (+1 lines)
Lines 627-632 the document URL will be used as referrer URL. Link Here
627
Specifies the User-Agent string to use for HTTP requests.
627
Specifies the User-Agent string to use for HTTP requests.
628
This can be useful when working with HTTP origin or proxy servers that
628
This can be useful when working with HTTP origin or proxy servers that
629
differentiate between user agents.
629
differentiate between user agents.
630
If used with an empty string no User-Agent is sent.
630
.It Ev NETRC
631
.It Ev NETRC
631
Specifies a file to use instead of
632
Specifies a file to use instead of
632
.Pa ~/.netrc
633
.Pa ~/.netrc
(-)lib/libfetch/http.c (-3 / +4 lines)
Lines 1679-1687 http_request(struct url *URL, const char *op, stru Link Here
1679
			else
1679
			else
1680
				http_cmd(conn, "Referer: %s", p);
1680
				http_cmd(conn, "Referer: %s", p);
1681
		}
1681
		}
1682
		if ((p = getenv("HTTP_USER_AGENT")) != NULL && *p != '\0')
1682
		if ((p = getenv("HTTP_USER_AGENT")) != NULL) {
1683
			http_cmd(conn, "User-Agent: %s", p);
1683
			if  (*p != '\0')
1684
		else
1684
				http_cmd(conn, "User-Agent: %s", p);
1685
		} else
1685
			http_cmd(conn, "User-Agent: %s " _LIBFETCH_VER, getprogname());
1686
			http_cmd(conn, "User-Agent: %s " _LIBFETCH_VER, getprogname());
1686
		if (url->offset > 0)
1687
		if (url->offset > 0)
1687
			http_cmd(conn, "Range: bytes=%lld-", (long long)url->offset);
1688
			http_cmd(conn, "Range: bytes=%lld-", (long long)url->offset);

Return to bug 184507