feat: add tags support

pull/48/head
fcying 2022-01-04 14:26:53 +08:00
parent a2424010f1
commit 0c1dfb7fd7
1 changed files with 4 additions and 0 deletions

View File

@ -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) {