Feat: readme in shared folder

This commit is contained in:
HFO4
2020-01-31 15:12:15 +08:00
parent cc2c3b3f0f
commit 4f0c2bbb29
4 changed files with 49 additions and 0 deletions

View File

@@ -255,6 +255,10 @@ func (service *SingleFileService) PreviewContent(ctx context.Context, c *gin.Con
// 直接返回文件内容
defer resp.Content.Close()
if isText {
c.Header("Cache-Control", "no-cache")
}
http.ServeContent(c.Writer, c.Request, fs.FileTarget[0].Name, fs.FileTarget[0].UpdatedAt, resp.Content)
return serializer.Response{