mirror of
https://github.com/OpenListTeam/OpenList.git
synced 2025-09-19 04:06:18 +08:00
fix(server): can't edit .md source files (#1159)
* fix(server): can't edit .md source files * chore * add ignore direct link args
This commit is contained in:
@ -114,9 +114,8 @@ func proxy(c *gin.Context, link *model.Link, file model.Obj, proxyRange bool) {
|
||||
link = common.ProxyRange(c, link, file.GetSize())
|
||||
}
|
||||
Writer := &common.WrittenResponseWriter{ResponseWriter: c.Writer}
|
||||
|
||||
//优先处理md文件
|
||||
if utils.Ext(file.GetName()) == "md" && setting.GetBool(conf.FilterReadMeScripts) {
|
||||
raw, _ := strconv.ParseBool(c.DefaultQuery("raw", "false"))
|
||||
if utils.Ext(file.GetName()) == "md" && setting.GetBool(conf.FilterReadMeScripts) && !raw {
|
||||
buf := bytes.NewBuffer(make([]byte, 0, file.GetSize()))
|
||||
w := &common.InterceptResponseWriter{ResponseWriter: Writer, Writer: buf}
|
||||
err = common.Proxy(w, c.Request, link, file)
|
||||
|
Reference in New Issue
Block a user