mirror of
https://github.com/usememos/memos.git
synced 2025-10-07 21:06:30 +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))
|
http.ServeContent(c.Response(), c.Request(), resource.Filename, time.Unix(resource.UpdatedTs, 0), bytes.NewReader(blob))
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
c.Response().Writer.Header().Set("Content-Disposition", fmt.Sprintf(`filename="%s"`, resource.Filename))
|
||||||
return c.Stream(http.StatusOK, resourceType, bytes.NewReader(blob))
|
return c.Stream(http.StatusOK, resourceType, bytes.NewReader(blob))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue