mirror of https://github.com/hunshcn/gh-proxy
Merge ee9bbf49f2
into 9b24915abe
commit
d104b35dd0
|
@ -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-).*$')
|
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>.+?)/.+?/.+$')
|
exp4 = re.compile(r'^(?:https?://)?raw\.(?:githubusercontent|github)\.com/(?P<author>.+?)/(?P<repo>.+?)/.+?/.+$')
|
||||||
exp5 = re.compile(r'^(?:https?://)?gist\.(?:githubusercontent|github)\.com/(?P<author>.+?)/.+?/.+$')
|
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()
|
requests.sessions.default_headers = lambda: CaseInsensitiveDict()
|
||||||
|
|
||||||
|
@ -107,7 +108,7 @@ def iter_content(self, chunk_size=1, decode_unicode=False):
|
||||||
|
|
||||||
|
|
||||||
def check_url(u):
|
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)
|
m = exp.match(u)
|
||||||
if m:
|
if m:
|
||||||
return m
|
return m
|
||||||
|
|
Loading…
Reference in New Issue