Files
weirsoe-party-protocol/lobby/http.py
Asger Geel Weirsøe a81bc1250c
Some checks failed
CI / test-and-quality (push) Failing after 4m4s
Big visual overhaul docker compsoe file etc
2026-03-23 14:11:30 +01:00

18 lines
320 B
Python

import json
from django.http import HttpRequest
def json_body(request: HttpRequest) -> dict:
if not request.body:
return {}
try:
return json.loads(request.body)
except json.JSONDecodeError:
return {}
def normalize_session_code(code: str) -> str:
return code.strip().upper()