Merge 9e662e6b5778af2b8df2097c54511758fad38a39 into ffa03bfda11aa18bb899afc1f29e8690fcea1036

This commit is contained in:
0x535a 2025-05-24 18:06:18 +08:00 committed by GitHub
commit 1fe36c03ff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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