add ip_adapter to api and fix control

This commit is contained in:
Vladimir Mandic
2024-03-29 10:26:27 -04:00
parent d7a18f0dfc
commit bd7ba768b1
11 changed files with 99 additions and 54 deletions
+1 -1
View File
@@ -43,7 +43,7 @@ def setup_middleware(app: FastAPI, cmd_opts):
endpoint = req.scope.get('path', 'err')
token = req.cookies.get("access-token") or req.cookies.get("access-token-unsecure")
if (cmd_opts.api_log or cmd_opts.api_only) and endpoint.startswith('/sdapi'):
if '/sdapi/v1/log' or '/sdapi/v1/browser' in endpoint:
if '/sdapi/v1/log' in endpoint or '/sdapi/v1/browser' in endpoint:
return res
log.info('API {user} {code} {prot}/{ver} {method} {endpoint} {cli} {duration}'.format( # pylint: disable=consider-using-f-string, logging-format-interpolation
user = app.tokens.get(token) if hasattr(app, 'tokens') else None,