Restore contact form and allow new host

This commit is contained in:
2026-05-13 17:39:16 +02:00
parent c1891951c0
commit be65ff51b4
4 changed files with 243 additions and 18 deletions

View File

@@ -11,6 +11,7 @@ RATE_LIMIT_MAX_REQUESTS = 5
MESSAGES_STORAGE = "portfolio_contact_messages"
ALLOWED_ORIGINS = {
"https://luna.reversed.dev",
"https://luna.spaceistyping.com",
"http://localhost:5173",
"http://localhost:4173",
}
@@ -18,7 +19,7 @@ EMAIL_RE = re.compile(r"^[^\s@]+@[^\s@]+\.[^\s@]+$")
def _cors_headers(origin=""):
allowed_origin = origin if origin in ALLOWED_ORIGINS else "https://luna.reversed.dev"
allowed_origin = origin if origin in ALLOWED_ORIGINS else "https://luna.spaceistyping.com"
return {
"Access-Control-Allow-Origin": allowed_origin,
"Access-Control-Allow-Methods": "GET, POST, OPTIONS",