8000 Make "s" in "https" optional to match URL w/ regex · staticdev/github4.py@648e584 · GitHub
[go: up one dir, main page]

Skip to content
8000
This repository was archived by the owner on May 22, 2021. It is now read-only.

Commit 648e584

Browse files
committed
Make "s" in "https" optional to match URL w/ regex
Some folks may be using a GitHub Enterprise server that doesn't support HTTPS.
1 parent 52a3f30 commit 648e584

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
@@ -1000,7 +1000,7 @@ def pubsubhubbub(self, mode, topic, callback, secret=''):
10001000
:returns: bool
10011001
"""
10021002
from re import match
1003-
m = match('https://[\w\d\-\.\:]+/\w+/[\w\._-]+/events/\w+', topic)
1003+
m = match('https?://[\w\d\-\.\:]+/\w+/[\w\._-]+/events/\w+', topic)
10041004
status = False
10051005
if mode and topic and callback and m:
10061006
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
@@ -77,7 +77,7 @@ def __init__(self, issue, session=None):
7777
self.number = issue.get('number')
7878
#: Dictionary URLs for the pull request (if they exist)
7979
self.pull_request = issue.get('pull_request')
80-
m = match('https://[\w\d\-\.\:]+/(\S+)/(\S+)/(?:issues|pull)/\d+',
80+
m = match('https?://[\w\d\-\.\:]+/(\S+)/(\S+)/(?:issues|pull)/\d+',
8181
self.html_url)
8282
#: Returns ('owner', 'repository') this issue was filed on.
8383
self.repository = m.groups()

github3/pulls.py

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

186 5965 -
m = match('https://[\w\d\-\.\:]+/(\S+)/(\S+)/(?:issues|pull)?/\d+',
186+
m = match('https?://[\w\d\-\.\:]+/(\S+)/(\S+)/(?:issues|pull)?/\d+',
187187
self.issue_url)
188188
#: Returns ('owner', 'repository') this issue was filed on.
189189
self.repository = m.groups()

0 commit comments

Comments
 (0)
0