fix(handles): fix the README checking issue

pull/8540/head
Stephen Zeng 2025-05-18 21:57:07 +08:00
parent 630cf30af5
commit 4b89b17bb5
1 changed files with 1 additions and 1 deletions

View File

@ -131,7 +131,7 @@ func localProxy(c *gin.Context, link *model.Link, file model.Obj, proxyRange boo
Writer := &common.WrittenResponseWriter{ResponseWriter: c.Writer} Writer := &common.WrittenResponseWriter{ResponseWriter: c.Writer}
//优先处理md文件 //优先处理md文件
if utils.Ext(file.GetName()) == "md" && setting.GetBool(conf.FilterReadMeScripts) { if file.GetName() == "README.md" && setting.GetBool(conf.FilterReadMeScripts) {
buf := bytes.NewBuffer(make([]byte, 0, file.GetSize())) buf := bytes.NewBuffer(make([]byte, 0, file.GetSize()))
w := &common.InterceptResponseWriter{ResponseWriter: Writer, Writer: buf} w := &common.InterceptResponseWriter{ResponseWriter: Writer, Writer: buf}
err = common.Proxy(w, c.Request, link, file) err = common.Proxy(w, c.Request, link, file)