From 0c1dfb7fd7e83d91944d5c333e3c90fa630cb44a Mon Sep 17 00:00:00 2001 From: fcying Date: Tue, 4 Jan 2022 14:26:53 +0800 Subject: [PATCH] feat: add tags support --- index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.js b/index.js index bf35c6c..0aff480 100644 --- a/index.js +++ b/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) {