Skip to content

Commit 6886838

Browse files
authored
更新为v1.1.8
1 parent 75833b9 commit 6886838

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

src/handlers/github.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -135,17 +135,11 @@ func proxyGitHubWithRedirect(c *gin.Context, u string, redirectCount int) {
135135
if contentType := resp.Header.Get("Content-Type"); blockedContentTypes[strings.ToLower(strings.Split(contentType, ";")[0])] {
136136
c.JSON(http.StatusForbidden, map[string]string{
137137
"error": "Content type not allowed",
138-
"message": "检测到网页内容,本服务不支持加速网页,仅支持加速资源下载。",
138+
"message": "检测到网页类型,本服务不支持加速网页,请检查您的链接是否正确。",
139139
})
140140
return
141141
}
142142
}
143-
144-
// 如果Github上游404,则返回错误信息。这样处理是否会更好点?暂时先用检查内容类型的方式吧,防止返回网页内容。欢迎大佬们提供更好的方案。
145-
// if resp.StatusCode == http.StatusNotFound {
146-
// c.String(http.StatusForbidden, "无效的GitHub地址")
147-
// return
148-
// }
149143

150144
// 检查文件大小限制
151145
cfg := config.GetConfig()

src/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ func main() {
125125
fmt.Printf("H2c: 已启用\n")
126126
}
127127

128-
fmt.Printf("版本号: v1.1.7\n")
128+
fmt.Printf("版本号: v1.1.8\n")
129129
fmt.Printf("项目地址: https://github.com/sky22333/hubproxy\n")
130130

131131
// 创建HTTP2服务器

0 commit comments

Comments
 (0)