aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Lange <DLange@git.local>2020-10-01 15:42:29 +0200
committerDaniel Lange <DLange@git.local>2020-10-01 17:21:07 +0200
commitf7c67d1b5e80366c33b252d9027ddf7688a454c3 (patch)
tree8642677aea54be88398b6e09f42bd95b3a5b868f
parentb7c1bb6ac4b91146030206d6f4f8199e2e638ac7 (diff)
downloadsupybot_github-f7c67d1b5e80366c33b252d9027ddf7688a454c3.tar.gz
supybot_github-f7c67d1b5e80366c33b252d9027ddf7688a454c3.tar.bz2
supybot_github-f7c67d1b5e80366c33b252d9027ddf7688a454c3.zip
Fix TypeError "expected bytes or bytearray, but got 'str'" with python3
-rw-r--r--local/handler/GithubHandler.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/local/handler/GithubHandler.py b/local/handler/GithubHandler.py
index 99c5931..1d77c33 100644
--- a/local/handler/GithubHandler.py
+++ b/local/handler/GithubHandler.py
@@ -123,7 +123,7 @@ class GithubHandler(http.server.BaseHTTPRequestHandler):
s.wfile.write("This channel requires a secret\n".encode())
return
- digest = "sha1=%s" % (hmac.new(secret, payload, hashlib.sha1).hexdigest(),)
+ digest = "sha1=%s" % (hmac.new(bytes(secret, 'utf-8'), bytes(payload, 'utf-8'), hashlib.sha1).hexdigest())
log.debug("expected digest: %s", digest)
provided = s.headers['X-Hub-Signature']

© 2014-2024 Faster IT GmbH | imprint | privacy policy