aboutsummaryrefslogtreecommitdiffstats
path: root/routers/api/packages/goproxy/goproxy.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/api/packages/goproxy/goproxy.go')
-rw-r--r--routers/api/packages/goproxy/goproxy.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/routers/api/packages/goproxy/goproxy.go b/routers/api/packages/goproxy/goproxy.go
index bde29df739..951f50053c 100644
--- a/routers/api/packages/goproxy/goproxy.go
+++ b/routers/api/packages/goproxy/goproxy.go
@@ -22,9 +22,8 @@ import (
)
func apiError(ctx *context.Context, status int, obj any) {
- helper.LogAndProcessError(ctx, status, obj, func(message string) {
- ctx.PlainText(status, message)
- })
+ message := helper.ProcessErrorForUser(ctx, status, obj)
+ ctx.PlainText(status, message)
}
func EnumeratePackageVersions(ctx *context.Context) {
@@ -106,7 +105,7 @@ func DownloadPackageFile(ctx *context.Context) {
return
}
- s, u, _, err := packages_service.GetPackageFileStream(ctx, pfs[0])
+ s, u, _, err := packages_service.OpenFileForDownload(ctx, pfs[0], ctx.Req.Method)
if err != nil {
if errors.Is(err, util.ErrNotExist) {
apiError(ctx, http.StatusNotFound, err)