pull/150/merge
Chung1912 2025-05-11 23:48:37 +08:00 committed by GitHub
commit d104b35dd0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -48,6 +48,7 @@ exp2 = re.compile(r'^(?:https?://)?github\.com/(?P<author>.+?)/(?P<repo>.+?)/(?:
exp3 = re.compile(r'^(?:https?://)?github\.com/(?P<author>.+?)/(?P<repo>.+?)/(?:info|git-).*$')
exp4 = re.compile(r'^(?:https?://)?raw\.(?:githubusercontent|github)\.com/(?P<author>.+?)/(?P<repo>.+?)/.+?/.+$')
exp5 = re.compile(r'^(?:https?://)?gist\.(?:githubusercontent|github)\.com/(?P<author>.+?)/.+?/.+$')
exp6 = re.compile(r'^(?:https?://)?github\.com/(?P<author>[^/]+)/(?P<repo>[^/]+)/(?P<type>[^/.]+)\.atom(?:\?.*)?$')
requests.sessions.default_headers = lambda: CaseInsensitiveDict()
@ -107,7 +108,7 @@ def iter_content(self, chunk_size=1, decode_unicode=False):
def check_url(u):
for exp in (exp1, exp2, exp3, exp4, exp5):
for exp in (exp1, exp2, exp3, exp4, exp5, exp6):
m = exp.match(u)
if m:
return m