From 2adf593fb873675e25f6b556904affc770a8b73b Mon Sep 17 00:00:00 2001 From: Alexander Kukushkin Date: Mon, 9 May 2016 09:31:29 +0200 Subject: [PATCH] finish method does not have any arguments --- patroni/api.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/patroni/api.py b/patroni/api.py index 0bda86ed..526da8b4 100644 --- a/patroni/api.py +++ b/patroni/api.py @@ -46,9 +46,10 @@ class RestApiHandler(BaseHTTPRequestHandler): self.wfile.write(body.encode('utf-8')) def send_auth_request(self, body): - self._write_response(401, body, {'WWW-Authenticate': 'Basic realm=\"Patroni\"'}) + headers = {'WWW-Authenticate': 'Basic realm="' + self.server.patroni.__class__.__name__ + '"'} + self._write_response(401, body, headers) - def finish(self, *args, **kwargs): + def finish(self): try: if not self.wfile.closed: self.wfile.flush()