mirror of
https://github.com/AlistGo/alist.git
synced 2025-12-19 11:00:06 +08:00
Merge 9e662e6b57 into 3cddb6b7ed
This commit is contained in:
commit
98b01286eb
@ -130,8 +130,8 @@ 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文件
|
absPath := c.Request.URL.String()
|
||||||
if utils.Ext(file.GetName()) == "md" && setting.GetBool(conf.FilterReadMeScripts) {
|
if absPath[1] == 'p' && utils.Ext(file.GetName()) == "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)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user