Skip to content

Commit dc7c9e2

Browse files
Fixed issue with checking of GitHub urls. Turned feature On by default.
1 parent e93186f commit dc7c9e2

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

README.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Install
99
=======
1010

1111
::
12+
1213
git clone [email protected]:carlos-jenkins/python-github-webhooks.git
1314
cd python-github-webhooks
1415

config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"github_ips_only": false,
2+
"github_ips_only": true,
33
"enforce_secret": "",
44
"return_scripts_info": true
55
}

webhooks.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ def index():
5656

5757
# Allow Github IPs only
5858
if config.get('github_ips_only', True):
59-
src_ip = ip_address(request.remote_addr)
59+
src_ip = ip_address(
60+
u'{}'.format(request.remote_addr) # Fix stupid ipaddress issue
61+
)
6062
for valid_ip in whitelist:
6163
if src_ip in ip_network(valid_ip):
6264
break

0 commit comments

Comments
 (0)