summaryrefslogtreecommitdiff
path: root/lib/libfetch/http.c
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2013-07-30 13:07:55 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2013-07-30 13:07:55 +0000
commit1453595f49c6b0d580bb57146a5981e73e80130e (patch)
treec1861e9adce3415d9dfbd32bebf77ef0dbdc08eb /lib/libfetch/http.c
parentcb67f01df2ae21b3d71ce96fd3812d4e2eb7edd5 (diff)
Notes
Diffstat (limited to 'lib/libfetch/http.c')
-rw-r--r--lib/libfetch/http.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/libfetch/http.c b/lib/libfetch/http.c
index 1fbc5ff9cac2..99b8030e7386 100644
--- a/lib/libfetch/http.c
+++ b/lib/libfetch/http.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2000-2011 Dag-Erling Smørgrav
+ * Copyright (c) 2000-2013 Dag-Erling Smørgrav
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -1664,6 +1664,12 @@ http_request(struct url *URL, const char *op, struct url_stat *us,
}
/* other headers */
+ if ((p = getenv("HTTP_ACCEPT")) != NULL) {
+ if (*p != '\0')
+ http_cmd(conn, "Accept: %s", p);
+ } else {
+ http_cmd(conn, "Accept: */*");
+ }
if ((p = getenv("HTTP_REFERER")) != NULL && *p != '\0') {
if (strcasecmp(p, "auto") == 0)
http_cmd(conn, "Referer: %s://%s%s",