Filter api password from arguments

pull/437/head
Paulus Schoutsen 2015-09-23 20:56:34 -07:00
parent 34e5ecb8ab
commit 62f016e7d2
1 changed files with 6 additions and 1 deletions

View File

@ -232,7 +232,12 @@ class RequestHandler(SimpleHTTPRequestHandler):
def log_message(self, fmt, *arguments):
""" Redirect built-in log to HA logging """
_LOGGER.info(fmt, *arguments)
if self.server.no_password_set:
_LOGGER.info(fmt, *arguments)
else:
_LOGGER.info(
fmt, *(arg.replace(self.server.api_password, '*******')
if isinstance(arg, str) else arg for arg in arguments))
def _handle_request(self, method): # pylint: disable=too-many-branches
""" Does some common checks and calls appropriate method. """