更新为v1.1.8
This commit is contained in:
@@ -135,18 +135,12 @@ 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()
|
||||
if contentLength := resp.Header.Get("Content-Length"); contentLength != "" {
|
||||
|
||||
@@ -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服务器
|
||||
|
||||
Reference in New Issue
Block a user