aboutsummaryrefslogtreecommitdiffstats
path: root/local
diff options
context:
space:
mode:
authorkongr45gpen <electrovesta@gmail.com>2016-09-16 14:14:14 +0300
committerkongr45gpen <electrovesta@gmail.com>2016-09-16 14:29:53 +0300
commit3902f3b980c0e2a885b965b4f2503244c3e68782 (patch)
tree11c8fc4d8e2272ae2a4323f9cf12711f5e35a79c /local
parent8a37f308903f3927b7442a38695ee0a99982a53c (diff)
downloadsupybot_github-3902f3b980c0e2a885b965b4f2503244c3e68782.tar.gz
supybot_github-3902f3b980c0e2a885b965b4f2503244c3e68782.tar.bz2
supybot_github-3902f3b980c0e2a885b965b4f2503244c3e68782.zip
Improve HTTP response
Diffstat (limited to 'local')
-rw-r--r--local/handler/GithubHandler.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/local/handler/GithubHandler.py b/local/handler/GithubHandler.py
index 909484e..b791298 100644
--- a/local/handler/GithubHandler.py
+++ b/local/handler/GithubHandler.py
@@ -95,22 +95,24 @@ class GithubHandler(BaseHTTPServer.BaseHTTPRequestHandler):
try:
s.send_response(200)
- s.send_header('Content-type', 'text/html')
+ s.send_header('Content-type', 'text/plain')
s.end_headers()
- s.wfile.write("Thanks, you're awesome.\n")
+ s.wfile.write("Thanks!\n")
s.wfile.write(s.path.split('/'))
+ s.wfile.write("\n")
except socket.error:
pass
if requireCode and receivedcode != configValue('passcode'):
# The password is wrong
- s.wfile.write("The password is wrong")
+ s.wfile.write("The password is wrong\n")
return
+ # Handle Github secrets
secret = getChannelSecret(channel)
if secret is not None:
if not 'X-Hub-Signature' in s.headers:
- s.wfile.write("This channel requires a secret")
+ s.wfile.write("This channel requires a secret\n")
return
digest = "sha1=%s" % (hmac.new(secret, payload, hashlib.sha1).hexdigest(),)
@@ -120,7 +122,7 @@ class GithubHandler(BaseHTTPServer.BaseHTTPRequestHandler):
log.debug("provided digest: %s", provided)
if not secureCompare(digest, provided):
- s.wfile.write("Invalid secret key")
+ s.wfile.write("Invalid secret key\n")
return
brackets = parseBrackets(configValue('brackets'))

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