Skip to content

Commit

Permalink
GitHub: Reply more nicely to POST requests.
Browse files Browse the repository at this point in the history
  • Loading branch information
progval committed Mar 27, 2013
1 parent 0f19d61 commit 21639e4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions GitHub/plugin.py
Expand Up @@ -74,7 +74,15 @@ def doPost(self, handler, path, form):
not handler.address_string() == 'localhost':
log.warning("""'%s' tried to act as a web hook for Github,
but is not GitHub.""" % handler.address_string())
self.send_response(403)
self.send_header('Content-type', 'text/plain')
self.end_headers()
self.wfile.write('Error: you are not a GitHub server.')
else:
self.send_response(200)
self.send_header('Content-type', 'text/plain')
self.end_headers()
self.wfile.write('Thanks.')
self.plugin.announce.onPayload(json.loads(form['payload'].value))

#####################
Expand Down

0 comments on commit 21639e4

Please sign in to comment.