From: Jan Broer Date: Mon, 18 Jan 2016 01:01:48 +0000 (+0100) Subject: Don't throw authentication error on the first request a HTTP client sends X-Git-Tag: dnsdist-1.0.0-alpha2~60^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cc55a8f2d4ecbe9646f4140616cc34ea82159e02;p=pdns Don't throw authentication error on the first request a HTTP client sends --- diff --git a/pdns/dnsdist-web.cc b/pdns/dnsdist-web.cc index e9c2c517a..d40c6eee5 100644 --- a/pdns/dnsdist-web.cc +++ b/pdns/dnsdist-web.cc @@ -88,7 +88,9 @@ static void connectionThread(int sock, ComboAddress remote, string password) resp.status=200; } else if (!compareAuthorization(req, password)) { - errlog("HTTP Request \"%s\" from %s: Web Authentication failed", req.url.path, remote.toStringWithPort()); + YaHTTP::strstr_map_t::iterator header = req.headers.find("authorization"); + if (header != req.headers.end()) + errlog("HTTP Request \"%s\" from %s: Web Authentication failed", req.url.path, remote.toStringWithPort()); resp.status=401; resp.body="

Unauthorized

"; resp.headers["WWW-Authenticate"] = "basic realm=\"PowerDNS\"";