1
0
mirror of https://github.com/pocketbase/pocketbase.git synced 2025-11-23 22:55:37 +02:00

[#1125] added support for partial/range file requests

This commit is contained in:
Gani Georgiev
2022-11-29 15:52:37 +02:00
parent 328b99a690
commit bd65125744
4 changed files with 70 additions and 24 deletions

View File

@@ -94,7 +94,9 @@ func (api *fileApi) download(c echo.Context) error {
}
return api.app.OnFileDownloadRequest().Trigger(event, func(e *core.FileDownloadEvent) error {
if err := fs.Serve(e.HttpContext.Response(), e.ServedPath, e.ServedName); err != nil {
res := e.HttpContext.Response()
req := e.HttpContext.Request()
if err := fs.Serve(res, req, e.ServedPath, e.ServedName); err != nil {
return NewNotFoundError("", err)
}