Serve: Properly enforce privacy mode

This commit is contained in:
rlaphoenix 2022-09-10 21:53:14 +01:00
parent e8226f605c
commit 16fd204743
1 changed files with 7 additions and 5 deletions

View File

@ -251,11 +251,13 @@ async def get_license_challenge(request: web.Request) -> web.Response:
}, status=400) }, status=400)
# enforce service certificate (opt-in) # enforce service certificate (opt-in)
if request.app["config"].get("force_privacy_mode") and not cdm.get_service_certificate(session_id): if request.app["config"].get("force_privacy_mode"):
return web.json_response({ privacy_mode = True
"status": 403, if not cdm.get_service_certificate(session_id):
"message": "No Service Certificate set but Privacy Mode is Enforced." return web.json_response({
}, status=403) "status": 403,
"message": "No Service Certificate set but Privacy Mode is Enforced."
}, status=403)
# get init data # get init data
init_data = PSSH(body["init_data"]) init_data = PSSH(body["init_data"])