mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 10:18:38 +00:00
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:
@@ -69,7 +69,7 @@ func packageDescriptorToMetadata(baseURL string, pd *packages_model.PackageDescr
|
||||
return &versionMetadata{
|
||||
Version: pd.Version.Version,
|
||||
ArchiveURL: fmt.Sprintf("%s/files/%s.tar.gz", baseURL, url.PathEscape(pd.Version.Version)),
|
||||
Published: time.Unix(int64(pd.Version.CreatedUnix), 0),
|
||||
Published: pd.Version.CreatedUnix.AsLocalTime(),
|
||||
Pubspec: pd.Metadata.(*pub_module.Metadata).Pubspec,
|
||||
}
|
||||
}
|
||||
@@ -271,5 +271,5 @@ func DownloadPackageFile(ctx *context.Context) {
|
||||
}
|
||||
defer s.Close()
|
||||
|
||||
ctx.ServeStream(s, pf.Name)
|
||||
ctx.ServeContent(pf.Name, s, pf.CreatedUnix.AsLocalTime())
|
||||
}
|
||||
|
Reference in New Issue
Block a user