Skip to content

Commit

Permalink
Merge pull request #19 from nickvasilyev/nickvasilyev-patch-1
Browse files Browse the repository at this point in the history
Filtering for localhost in case ngrok is used
  • Loading branch information
razius authored Apr 3, 2017
2 parents dd03b1f + 450a1a9 commit a4d5faa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ def index():
if ipaddress.ip_address(request_ip) in ipaddress.ip_network(block):
break # the remote_addr is within the network range of github.
else:
abort(403)
if str(request_ip) != '127.0.0.1':
abort(403)

if request.headers.get('X-GitHub-Event') == "ping":
return json.dumps({'msg': 'Hi!'})
Expand Down

0 comments on commit a4d5faa

Please sign in to comment.