10000 Updated github url regexes to allow plain HTTP (for non-https enabled… · mikewaters/github3.py@d1c597c · GitHub
[go: up one dir, main page]

Skip to content

Commit d1c597c

Browse files
author
Mike Waters
committed
Updated github url regexes to allow plain HTTP (for non-https enabled enterprise instances).
1 parent 8aa02b7 commit d1c597c

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

github3/github.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -972,7 +972,7 @@ def pubsubhubbub(self, mode, topic, callback, secret=''):
972972
:returns: bool
973973
"""
974974
from re import match
975-
m = match('https://[\w\d\-\.\:]+/\w+/[\w\._-]+/events/\w+', topic)
975+
m = match('http[s]?://[\w\d\-\.\:]+/\w+/[\w\._-]+/events/\w+', topic)
976976
status = False
977977
if mode and topic and callback and m:
978978
data = [('hub.mode', mode), ('hub.topic', topic),

github3/issues/issue.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def __init__(self, issue, session=None):
7575
self.number = issue.get('number')
7676
#: Dictionary URLs for the pull request (if they exist)
7777
self.pull_request = issue.get('pull_request')
78-
m = match('https://[\w\d\-\.\:]+/(\S+)/(\S+)/(?:issues|pull)/\d+',
78+
m = match('http[s]?://[\w\d\-\.\:]+/(\S+)/(\S+)/(?:issues|pull)/\d+',
7979
self.html_url)
8080
#: Returns ('owner', 'repository') this issue was filed on.
8181
self.repository = m.groups()

github3/pulls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def __init__(self, pull, session=None):
186186
#: GitHub.com url for review comments (not a template)
187187
self.review_comments_url = pull.get('review_comments_url')
188188

189-
m = match('https://[\w\d\-\.\:]+/(\S+)/(\S+)/(?:issues|pull)?/\d+',
189+
m = match('http[s]?://[\w\d\-\.\:]+/(\S+)/(\S+)/(?:issues|pull)?/\d+',
190190
self.issue_url)
191191
#: Returns ('owner', 'repository') this issue was filed on.
192192
self.repository = m.groups()

0 commit comments

Comments
 (0)
0