mirror of https://github.com/hunshcn/gh-proxy
feat: add tags support
parent
a2424010f1
commit
0c1dfb7fd7
4
index.js
4
index.js
|
@ -71,9 +71,13 @@ async function fetchHandler(e) {
|
|||
const exp4 = /^(?:https?:\/\/)?raw\.(?:githubusercontent|github)\.com\/.+?\/.+?\/.+?\/.+$/i
|
||||
const exp5 = /^(?:https?:\/\/)?gist\.(?:githubusercontent|github)\.com\/.+?\/.+?\/.+$/i
|
||||
const exp6 = /^(?:https?:\/\/)?github\.com\/.+?\/.+?\/releases\/latest\/?$/i
|
||||
const exp7 = /^(?:https?:\/\/)?github\.com\/.+?\/.+?\/tags\/?$/i
|
||||
if (path.search(exp6) === 0) {
|
||||
return httpHandler(req, path, 'manual')
|
||||
}
|
||||
else if (path.search(exp7) === 0) {
|
||||
return httpHandler(req, path, 'follow')
|
||||
}
|
||||
else if (path.search(exp1) === 0 || path.search(exp5) === 0 || !Config.cnpmjs && (path.search(exp3) === 0 || path.search(exp4) === 0)) {
|
||||
return httpHandler(req, path, 'follow')
|
||||
} else if (path.search(exp2) === 0) {
|
||||
|
|
Loading…
Reference in New Issue