FreeBSD Bugzilla – Attachment 15144 Details for
Bug 28171
[PATCH] to support a HTTP_REFERER env variable in libfetch
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 1.09 KB, created by
Andre Albsmeier
on 2001-06-15 09:30:04 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Andre Albsmeier
Created:
2001-06-15 09:30:04 UTC
Size:
1.09 KB
patch
obsolete
>--- lib/libfetch/http.c.ORI Fri Jun 15 09:21:40 2001 >+++ lib/libfetch/http.c Fri Jun 15 10:14:38 2001 >@@ -775,6 +775,15 @@ > } > > /* other headers */ >+ if ((p = getenv("HTTP_REFERER")) != NULL && *p != '\0') { >+ if (strcmp(p,"auto") == 0) { >+ char ps[7]; >+ snprintf (ps,sizeof(ps),":%d",url->port); >+ _http_cmd(fd, "Referer: %s://%s%s%s", >+ url->scheme, host, url->port == 80 ? "" : ps, url->doc); >+ } else >+ _http_cmd(fd,"Referer: %s",p); >+ } > if ((p = getenv("HTTP_USER_AGENT")) != NULL && *p != '\0') > _http_cmd(fd, "User-Agent: %s", p); > else >--- lib/libfetch/fetch.3.ORI Fri Jun 15 09:46:18 2001 >+++ lib/libfetch/fetch.3 Fri Jun 15 10:16:14 2001 >@@ -491,6 +491,10 @@ > 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 usder agents. >+.It Ev HTTP_REFERER >+Specifies the Referer string to use for HTTP requests. >+This can be useful when working with HTTP servers that insist in them. >+When set to "auto" the URL is taken to construct a referer value. > .El > .Sh SEE ALSO > .Xr fetch 1 ,
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 28171
: 15144