Replace ServeStream
with ServeContent
(#20903)
* Replace ServeStream with ServeContent. * Update modules/timeutil/timestamp.go Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
This commit is contained in:
parent
5e232e86de
commit
dc0253b063
17 changed files with 31 additions and 41 deletions
|
@ -179,7 +179,7 @@ func DownloadPackageFile(ctx *context.Context) {
|
|||
}
|
||||
defer s.Close()
|
||||
|
||||
ctx.ServeStream(s, pf.Name)
|
||||
ctx.ServeContent(pf.Name, s, pf.CreatedUnix.AsLocalTime())
|
||||
}
|
||||
|
||||
// UploadPackage creates a new package with the metadata contained in the uploaded nupgk file
|
||||
|
@ -378,7 +378,7 @@ func DownloadSymbolFile(ctx *context.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
s, _, err := packages_service.GetPackageFileStream(ctx, pfs[0])
|
||||
s, pf, err := packages_service.GetPackageFileStream(ctx, pfs[0])
|
||||
if err != nil {
|
||||
if err == packages_model.ErrPackageNotExist || err == packages_model.ErrPackageFileNotExist {
|
||||
apiError(ctx, http.StatusNotFound, err)
|
||||
|
@ -389,7 +389,7 @@ func DownloadSymbolFile(ctx *context.Context) {
|
|||
}
|
||||
defer s.Close()
|
||||
|
||||
ctx.ServeStream(s, pfs[0].Name)
|
||||
ctx.ServeContent(pf.Name, s, pf.CreatedUnix.AsLocalTime())
|
||||
}
|
||||
|
||||
// DeletePackage hard deletes the package
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue