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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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