app: improve debug logging
Dont log the full response when html is requested. Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
parent
2314ea74c2
commit
fd5053ecac
|
@ -602,12 +602,15 @@ class DynamicRequestHandler(AuthorizedRequestHandler):
|
||||||
args[key] = value
|
args[key] = value
|
||||||
return args
|
return args
|
||||||
|
|
||||||
def _log_debug(self, header: str, args: Dict[str, Any]) -> None:
|
def _log_debug(self, header: str, args: Any) -> None:
|
||||||
if self.server.is_debug_enabled():
|
if self.server.is_debug_enabled():
|
||||||
|
resp = args
|
||||||
|
if isinstance(args, dict):
|
||||||
if self.request.path.startswith('/access'):
|
if self.request.path.startswith('/access'):
|
||||||
resp = {key: "<sanitized>" for key in args}
|
resp = {key: "<sanitized>" for key in args}
|
||||||
else:
|
elif isinstance(args, str):
|
||||||
resp = args
|
if args.startswith("<html>"):
|
||||||
|
resp = "<html>"
|
||||||
logging.debug(f"{header}::{resp}")
|
logging.debug(f"{header}::{resp}")
|
||||||
|
|
||||||
async def get(self, *args, **kwargs) -> None:
|
async def get(self, *args, **kwargs) -> None:
|
||||||
|
|
Loading…
Reference in New Issue