diff options
author | Daniel Lange <DLange@git.local> | 2020-10-01 15:42:29 +0200 |
---|---|---|
committer | Daniel Lange <DLange@git.local> | 2020-10-01 17:21:07 +0200 |
commit | f7c67d1b5e80366c33b252d9027ddf7688a454c3 (patch) | |
tree | 8642677aea54be88398b6e09f42bd95b3a5b868f | |
parent | b7c1bb6ac4b91146030206d6f4f8199e2e638ac7 (diff) | |
download | supybot_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.py | 2 |
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'] |