diff options
-rw-r--r-- | doc/examples/configure-index | 1 | ||||
-rw-r--r-- | methods/http.cc | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/doc/examples/configure-index b/doc/examples/configure-index index 65590f17b..99aedfd19 100644 --- a/doc/examples/configure-index +++ b/doc/examples/configure-index @@ -270,6 +270,7 @@ Acquire No-Store "false"; // Prevent the cache from storing archives Dl-Limit "<INT>"; // Kb/sec maximum download rate User-Agent "Debian APT-HTTP/1.3"; + Referer "<STRING>"; // Set the HTTP Referer [sic!] header to given value }; // HTTPS method configuration: uses the http diff --git a/methods/http.cc b/methods/http.cc index 2e7fca307..d75e9fe84 100644 --- a/methods/http.cc +++ b/methods/http.cc @@ -974,6 +974,10 @@ void HttpMethod::SendReq(FetchItem *Itm) Req << "User-Agent: " << ConfigFind("User-Agent", "Debian APT-HTTP/1.3 (" PACKAGE_VERSION ")") << "\r\n"; + auto const referer = ConfigFind("Referer", ""); + if (referer.empty() == false) + Req << "Referer: " << referer << "\r\n"; + Req << "\r\n"; if (Debug == true) |