decode the utf8 encoded body to a unicode string before passing it on
This commit is contained in:
parent
0d5d6dc31e
commit
7506326cd7
|
@ -603,7 +603,7 @@ class CoinifyCallbackView(SingleObjectMixin, View):
|
||||||
|
|
||||||
# attempt to parse json
|
# attempt to parse json
|
||||||
try:
|
try:
|
||||||
parsed = json.loads(request.body)
|
parsed = json.loads(request.body.decode('utf-8'))
|
||||||
except Exception as E:
|
except Exception as E:
|
||||||
parsed = ''
|
parsed = ''
|
||||||
|
|
||||||
|
@ -622,7 +622,7 @@ class CoinifyCallbackView(SingleObjectMixin, View):
|
||||||
return HttpResponseBadRequest('unable to parse json')
|
return HttpResponseBadRequest('unable to parse json')
|
||||||
|
|
||||||
# attemt to validate the callbackc
|
# attemt to validate the callbackc
|
||||||
if sdk.validate_callback(request.body, signature):
|
if sdk.validate_callback(request.body.decode('utf-8'), signature):
|
||||||
# mark callback as valid in db
|
# mark callback as valid in db
|
||||||
callbackobject.valid=True
|
callbackobject.valid=True
|
||||||
callbackobject.save()
|
callbackobject.save()
|
||||||
|
|
Loading…
Reference in a new issue