diff --git a/src/handlers/github.go b/src/handlers/github.go index 5ceb7b5..f37ec33 100644 --- a/src/handlers/github.go +++ b/src/handlers/github.go @@ -135,17 +135,11 @@ func proxyGitHubWithRedirect(c *gin.Context, u string, redirectCount int) { if contentType := resp.Header.Get("Content-Type"); blockedContentTypes[strings.ToLower(strings.Split(contentType, ";")[0])] { c.JSON(http.StatusForbidden, map[string]string{ "error": "Content type not allowed", - "message": "检测到网页内容,本服务不支持加速网页,仅支持加速资源下载。", + "message": "检测到网页类型,本服务不支持加速网页,请检查您的链接是否正确。", }) return } } - - // 如果Github上游404,则返回错误信息。这样处理是否会更好点?暂时先用检查内容类型的方式吧,防止返回网页内容。欢迎大佬们提供更好的方案。 - // if resp.StatusCode == http.StatusNotFound { - // c.String(http.StatusForbidden, "无效的GitHub地址") - // return - // } // 检查文件大小限制 cfg := config.GetConfig() diff --git a/src/main.go b/src/main.go index 4c98731..c11e462 100644 --- a/src/main.go +++ b/src/main.go @@ -125,7 +125,7 @@ func main() { fmt.Printf("H2c: 已启用\n") } - fmt.Printf("版本号: v1.1.7\n") + fmt.Printf("版本号: v1.1.8\n") fmt.Printf("项目地址: https://github.com/sky22333/hubproxy\n") // 创建HTTP2服务器