Skip to content

Commit a814d93

Browse files
committed
Correctly use byte strings for responses
1 parent 56dfe4a commit a814d93

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pgcommitfest/commitfest/views.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1547,11 +1547,11 @@ def cfbot_ingest(message):
15471547
@csrf_exempt
15481548
def cfbot_notify(request):
15491549
if request.method != "POST":
1550-
return HttpResponseForbidden("Invalid method")
1550+
return HttpResponseForbidden(b"Invalid method")
15511551

15521552
j = json.loads(request.body)
15531553
if not hmac.compare_digest(j["shared_secret"], settings.CFBOT_SECRET):
1554-
return HttpResponseForbidden("Invalid API key")
1554+
return HttpResponseForbidden(b"Invalid API key")
15551555

15561556
cfbot_ingest(j)
15571557
return HttpResponse(status=200)
@@ -1560,11 +1560,11 @@ def cfbot_notify(request):
15601560
@csrf_exempt
15611561
def thread_notify(request):
15621562
if request.method != "POST":
1563-
return HttpResponseForbidden("Invalid method")
1563+
return HttpResponseForbidden(b"Invalid method")
15641564

15651565
j = json.loads(request.body)
15661566
if j["apikey"] != settings.ARCHIVES_APIKEY:
1567-
return HttpResponseForbidden("Invalid API key")
1567+
return HttpResponseForbidden(b"Invalid API key")
15681568

15691569
for m in j["messageids"]:
15701570
try:

0 commit comments

Comments
 (0)