summaryrefslogtreecommitdiffstats
path: root/routers/api/packages/pub
diff options
context:
space:
mode:
authorKN4CK3R <admin@oldschoolhack.me>2022-08-25 18:05:21 +0200
committerGitHub <noreply@github.com>2022-08-25 12:05:21 -0400
commitdc0253b0637bbf367ad330612900e780c6b2b0e6 (patch)
tree85a51c2e9b355bef889e6fdae2e71b49fd645fbb /routers/api/packages/pub
parent5e232e86de6bb26038e0ebaec60368d54a327446 (diff)
downloadgitea-dc0253b0637bbf367ad330612900e780c6b2b0e6.tar.gz
gitea-dc0253b0637bbf367ad330612900e780c6b2b0e6.zip
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>
Diffstat (limited to 'routers/api/packages/pub')
-rw-r--r--routers/api/packages/pub/pub.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/routers/api/packages/pub/pub.go b/routers/api/packages/pub/pub.go
index 470f446238..9af0ceeb0e 100644
--- a/routers/api/packages/pub/pub.go
+++ b/routers/api/packages/pub/pub.go
@@ -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())
}