mirror of https://github.com/Xhofe/alist
fix(handles): check whether is a download or preview link
delete binary filepull/8540/head
parent
dd5c564918
commit
9e662e6b57
|
@ -130,7 +130,8 @@ func localProxy(c *gin.Context, link *model.Link, file model.Obj, proxyRange boo
|
|||
}
|
||||
Writer := &common.WrittenResponseWriter{ResponseWriter: c.Writer}
|
||||
|
||||
if strings.EqualFold(file.GetName(), "README.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)
|
||||
|
|
Loading…
Reference in New Issue