tests: fix mypy type errors in security tests
Some checks failed
CI / Lint & Format (push) Successful in 22s
CI / Security Scan (push) Successful in 21s
CI / Unit Tests (push) Failing after 17s
CI / Advanced Security Tests (push) Failing after 14s
CI / Memory Leak Check (push) Successful in 20s
CI / Security Tests (push) Successful in 25s
CI / Build & Push Image (push) Has been skipped
CI / SBOM Generation (push) Successful in 20s
Some checks failed
CI / Lint & Format (push) Successful in 22s
CI / Security Scan (push) Successful in 21s
CI / Unit Tests (push) Failing after 17s
CI / Advanced Security Tests (push) Failing after 14s
CI / Memory Leak Check (push) Successful in 20s
CI / Security Tests (push) Successful in 25s
CI / Build & Push Image (push) Has been skipped
CI / SBOM Generation (push) Successful in 20s
This commit is contained in:
@@ -565,7 +565,7 @@ def is_trusted_proxy() -> bool:
|
||||
Result is cached per-request in Flask's g object for efficiency.
|
||||
"""
|
||||
if hasattr(g, "_trusted_proxy"):
|
||||
return g._trusted_proxy
|
||||
return bool(g._trusted_proxy)
|
||||
|
||||
expected = current_app.config.get("TRUSTED_PROXY_SECRET", "")
|
||||
if not expected:
|
||||
@@ -573,7 +573,7 @@ def is_trusted_proxy() -> bool:
|
||||
return True
|
||||
provided = request.headers.get("X-Proxy-Secret", "")
|
||||
g._trusted_proxy = hmac.compare_digest(expected, provided)
|
||||
return g._trusted_proxy
|
||||
return bool(g._trusted_proxy)
|
||||
|
||||
|
||||
def get_client_fingerprint() -> str | None:
|
||||
|
||||
Reference in New Issue
Block a user