Big visual overhaul docker compsoe file etc
Some checks failed
CI / test-and-quality (push) Failing after 4m4s
Some checks failed
CI / test-and-quality (push) Failing after 4m4s
This commit is contained in:
17
lobby/http.py
Normal file
17
lobby/http.py
Normal file
@@ -0,0 +1,17 @@
|
||||
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()
|
||||
Reference in New Issue
Block a user