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

(-)lib/libfetch/http.c (+9 lines)
Lines 775-780 Link Here
775
	}
775
	}
776
776
777
	/* other headers */
777
	/* other headers */
778
	if ((p = getenv("HTTP_REFERER")) != NULL && *p != '\0') {
779
	    if (strcmp(p,"auto") == 0) {
780
		char ps[7];
781
		snprintf (ps,sizeof(ps),":%d",url->port);
782
		_http_cmd(fd, "Referer: %s://%s%s%s",
783
		     url->scheme, host, url->port == 80 ? "" : ps, url->doc);
784
	    } else
785
		_http_cmd(fd,"Referer: %s",p);
786
	}
778
	if ((p = getenv("HTTP_USER_AGENT")) != NULL && *p != '\0')
787
	if ((p = getenv("HTTP_USER_AGENT")) != NULL && *p != '\0')
779
	    _http_cmd(fd, "User-Agent: %s", p);
788
	    _http_cmd(fd, "User-Agent: %s", p);
780
	else
789
	else
(-)lib/libfetch/fetch.3 (+4 lines)
Lines 491-496 Link Here
491
Specifies the User-Agent string to use for HTTP requests.
491
Specifies the User-Agent string to use for HTTP requests.
492
This can be useful when working with HTTP origin or proxy servers that
492
This can be useful when working with HTTP origin or proxy servers that
493
differentiate between usder agents.
493
differentiate between usder agents.
494
.It Ev HTTP_REFERER
495
Specifies the Referer string to use for HTTP requests.
496
This can be useful when working with HTTP servers that insist in them.
497
When set to "auto" the URL is taken to construct a referer value.
494
.El
498
.El
495
.Sh SEE ALSO
499
.Sh SEE ALSO
496
.Xr fetch 1 ,
500
.Xr fetch 1 ,

Return to bug 28171