mirror of
https://github.com/usememos/memos.git
synced 2024-11-10 17:02:21 +08:00
feat: add header into resource response (#2120)
Update - add header for get resource
This commit is contained in:
parent
723c444910
commit
c835231d32
1 changed files with 1 additions and 0 deletions
|
@ -490,6 +490,7 @@ func (s *APIV1Service) streamResource(c echo.Context) error {
|
|||
http.ServeContent(c.Response(), c.Request(), resource.Filename, time.Unix(resource.UpdatedTs, 0), bytes.NewReader(blob))
|
||||
return nil
|
||||
}
|
||||
c.Response().Writer.Header().Set("Content-Disposition", fmt.Sprintf(`filename="%s"`, resource.Filename))
|
||||
return c.Stream(http.StatusOK, resourceType, bytes.NewReader(blob))
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue