Small tweaks/typos

This commit is contained in:
Thomas Sileo 2022-08-29 09:09:28 +02:00
parent 727eaa9ee1
commit ee5265f4dd

View file

@ -135,9 +135,7 @@ class CustomMiddleware:
"content-security-policy" "content-security-policy"
] = "default-src 'self'; style-src 'self' 'unsafe-inline';" ] = "default-src 'self'; style-src 'self' 'unsafe-inline';"
if not DEBUG: if not DEBUG:
headers[ headers["strict-transport-security"] = "max-age=63072000;"
"strict-transport-security"
] = "max-age=63072000; includeSubdomains"
await send(message) # type: ignore await send(message) # type: ignore
@ -220,7 +218,7 @@ async def custom_http_exception_handler(
title = ( title = (
{ {
404: "Oops, nothing to see here", 404: "Oops, nothing to see here",
500: "Opps, somethine went wrong", 500: "Oops, something went wrong",
} }
).get(exc.status_code, exc.detail) ).get(exc.status_code, exc.detail)
try: try:
@ -1103,6 +1101,7 @@ async def serve_attachment(
return FileResponse( return FileResponse(
UPLOAD_DIR / content_hash, UPLOAD_DIR / content_hash,
media_type=upload.content_type, media_type=upload.content_type,
headers={"Cache-Control": "max-age=31536000"},
) )