enhance security by adding cache control headers, validating password length, and rejecting encoded slashes in path processing

This commit is contained in:
Eduardo Silva
2026-03-16 20:36:49 -03:00
parent ca63b87123
commit fb17394099
4 changed files with 26 additions and 3 deletions

View File

@@ -57,6 +57,7 @@ async def auth_check(request: Request):
return re.sub(r"[\r\n\x00]", "", value)
response = PlainTextResponse("OK", status_code=200)
response.headers["Cache-Control"] = "no-store"
if session:
if session.username:
response.headers["X-Auth-User"] = _safe_header(session.username)