feat: add header into resource response (#2120)

Update - add header for get resource
This commit is contained in:
Jianwei Zhang
2023-08-10 23:45:30 +08:00
committed by GitHub
parent 723c444910
commit c835231d32

View File

@ -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))
}