mirror of
https://github.com/WJQSERVER-STUDIO/ghproxy.git
synced 2026-02-03 00:01:10 +08:00
4.3.0
This commit is contained in:
parent
8dca51b897
commit
d389a61f09
10 changed files with 273 additions and 155 deletions
|
|
@ -23,6 +23,7 @@ const (
|
|||
gistPrefix = "https://gist.github.com/"
|
||||
gistContentPrefix = "https://gist.githubusercontent.com/"
|
||||
apiPrefix = "https://api.github.com/"
|
||||
ociv2Prefix = "https://v2/"
|
||||
releasesDownloadSnippet = "releases/download/"
|
||||
)
|
||||
|
||||
|
|
@ -36,9 +37,11 @@ func init() {
|
|||
|
||||
// Matcher 从原始URL路径中高效地解析并匹配代理规则.
|
||||
func Matcher(rawPath string, cfg *config.Config) (string, string, string, *GHProxyErrors) {
|
||||
if len(rawPath) < 18 {
|
||||
return "", "", "", NewErrorWithStatusLookup(404, "path too short")
|
||||
}
|
||||
/*
|
||||
if len(rawPath) < 18 {
|
||||
return "", "", "", NewErrorWithStatusLookup(404, "path too short")
|
||||
}
|
||||
*/
|
||||
|
||||
// 匹配 "https://github.com/"
|
||||
if strings.HasPrefix(rawPath, githubPrefix) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue