From adf5f02571830eb284356faf782623d6b6a531d6 Mon Sep 17 00:00:00 2001 From: Pieter Lexis Date: Tue, 19 Feb 2019 12:18:01 +0100 Subject: [PATCH] Don't expose version number in User-Agent header --- docs/lua-records/functions.rst | 2 +- pdns/lua-record.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/lua-records/functions.rst b/docs/lua-records/functions.rst index 7cbbe086bc..d180c76b52 100644 --- a/docs/lua-records/functions.rst +++ b/docs/lua-records/functions.rst @@ -69,7 +69,7 @@ Record creation functions - ``backupSelector``: used to pick the IP address from list of all candidates if all addresses are down. Choices include 'pickclosest', 'random', 'hashed', 'all' (default to 'random'). - ``source``: Source IP address to check from - ``stringmatch``: check ``url`` for this string, only declare 'up' if found - - ``useragent``: Set the HTTP "User-Agent" header in the requests. By default it is set to "PowerDNS Authoritative Server/" plus the version number + - ``useragent``: Set the HTTP "User-Agent" header in the requests. By default it is set to "PowerDNS Authoritative Server" An example of IP address sets: diff --git a/pdns/lua-record.cc b/pdns/lua-record.cc index ce0170bce8..cef5788023 100644 --- a/pdns/lua-record.cc +++ b/pdns/lua-record.cc @@ -185,7 +185,7 @@ void IsUpOracle::checkURLThread(ComboAddress rem, std::string url, const opts_t& setDown(rem, url, opts); for(bool first=true;;first=false) { try { - string useragent = productName() + "/" + getPDNSVersion(); + string useragent = productName(); if (opts.count("useragent")) { useragent = opts.at("useragent"); } -- 2.39.2