We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 381afc8 commit 18a9281Copy full SHA for 18a9281
dj_elastictranscoder/views.py
@@ -134,9 +134,16 @@ def endpoint(request):
134
Receive SNS notification
135
"""
136
data = {}
137
+
138
+ # Request body can be bytes or string
139
try:
- data = json.loads(request.body)
- except ValueError:
140
+ request_body = request.body.decode("utf-8")
141
+ except AttributeError:
142
+ request_body = request.body
143
144
+ try:
145
+ data = json.loads(request_body)
146
+ except ValueError as e:
147
return HttpResponseBadRequest(str(e))
148
149
0 commit comments