Gitlab CSE Unil

Commit 45945331 authored by M. Chardon's avatar M. Chardon
Browse files

correction bug apostrophe dans activité moodle

parent fcdc9cad
......@@ -4,7 +4,7 @@
from hashlib import sha256
import hmac
from base64 import b64decode
from base64 import urlsafe_b64decode
import json
from time import time
import logging
......@@ -34,8 +34,9 @@ def get_attp_message(attp_msg64, attp_hash):
"""
msg_data = None
try:
msg_str = b64decode(attp_msg64)
msg = json.loads(msg_str)
msg_str = urlsafe_b64decode(attp_msg64)
msg_str_decode = str(msg_str, "utf-8")
msg = json.loads(msg_str_decode)
except (TypeError, ValueError, IndexError):
# malformed massage
# TODO: log malformed message error
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment