Log more info when rejecting connections.
This commit is contained in:
@@ -212,7 +212,10 @@ def auth_before(req: Request, settings: Settings, db) -> Response | None:
|
||||
|
||||
# Check trusted proxy
|
||||
if not is_trusted_proxy(req, settings):
|
||||
return PlainTextResponse("Forbidden: Request not from trusted proxy", status_code=403)
|
||||
client_ip = req.client.host if req.client else "unknown"
|
||||
return PlainTextResponse(
|
||||
f"Forbidden: Request not from trusted proxy (source: {client_ip})", status_code=403
|
||||
)
|
||||
|
||||
# Extract username from auth header
|
||||
username = req.headers.get(settings.auth_header_name.lower())
|
||||
|
||||
Reference in New Issue
Block a user