Skip to content

Commit a0df3b1

Browse files
author
user123456
committed
修复gist正则匹配
1 parent 70bf552 commit a0df3b1

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,11 @@ host = "0.0.0.0"
109109
port = 5000
110110
# Github文件大小限制(字节),默认2GB
111111
fileSize = 2147483648
112-
# HTTP/2 多路复用
112+
# HTTP/2 多路复用,提升下载速度
113113
enableH2C = false
114114
115115
[rateLimit]
116-
# 每个IP每小时允许的请求数(注意Docker镜像会有多个层,会消耗多个次数)
116+
# 每个IP每周期允许的请求数(注意Docker镜像会有多个层,会消耗多个次数)
117117
requestLimit = 500
118118
# 限流周期(小时)
119119
periodHours = 3.0

src/config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ fileSize = 2147483648
88
enableH2C = false
99

1010
[rateLimit]
11-
# 每个IP每小时允许的请求数(注意Docker镜像会有多个层,会消耗多个次数)
11+
# 每个IP每周期允许的请求数
1212
requestLimit = 500
1313
# 限流周期(小时)
1414
periodHours = 3.0

src/handlers/github.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ var (
2020
regexp.MustCompile(`^(?:https?://)?github\.com/([^/]+)/([^/]+)/(?:blob|raw)/.*`),
2121
regexp.MustCompile(`^(?:https?://)?github\.com/([^/]+)/([^/]+)/(?:info|git-).*`),
2222
regexp.MustCompile(`^(?:https?://)?raw\.github(?:usercontent|)\.com/([^/]+)/([^/]+)/.+?/.+`),
23-
regexp.MustCompile(`^(?:https?://)?gist\.github(?:usercontent|)\.com/([^/]+)/.+?/.+`),
23+
regexp.MustCompile(`^(?:https?://)?gist\.(?:githubusercontent|github)\.com/(.+?)/(.+?)/.+\.[a-zA-Z0-9]+$`),
2424
regexp.MustCompile(`^(?:https?://)?api\.github\.com/repos/([^/]+)/([^/]+)/.*`),
2525
regexp.MustCompile(`^(?:https?://)?huggingface\.co(?:/spaces)?/([^/]+)/(.+)`),
2626
regexp.MustCompile(`^(?:https?://)?cdn-lfs\.hf\.co(?:/spaces)?/([^/]+)/([^/]+)(?:/(.*))?`),

0 commit comments

Comments
 (0)