Unverified Commit c835231d authored by Jianwei Zhang's avatar Jianwei Zhang Committed by GitHub

feat: add header into resource response (#2120)

Update - add header for get resource
parent 723c4449
...@@ -490,6 +490,7 @@ func (s *APIV1Service) streamResource(c echo.Context) error { ...@@ -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))
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment