mirror of
https://github.com/go-gitea/gitea.git
synced 2025-10-09 18:26:30 +00:00
Fix some package registry problems (#34759)
1. Fix #33787 2. Fix container image display
This commit is contained in:
@@ -599,6 +599,12 @@ func GetPackageFileStream(ctx context.Context, pf *packages_model.PackageFile) (
|
||||
return GetPackageBlobStream(ctx, pf, pb, nil)
|
||||
}
|
||||
|
||||
func OpenBlobStream(pb *packages_model.PackageBlob) (io.ReadSeekCloser, error) {
|
||||
cs := packages_module.NewContentStore()
|
||||
key := packages_module.BlobHash256Key(pb.HashSHA256)
|
||||
return cs.OpenBlob(key)
|
||||
}
|
||||
|
||||
// GetPackageBlobStream returns the content of the specific package blob
|
||||
// If the storage supports direct serving and it's enabled, only the direct serving url is returned.
|
||||
func GetPackageBlobStream(ctx context.Context, pf *packages_model.PackageFile, pb *packages_model.PackageBlob, serveDirectReqParams url.Values) (io.ReadSeekCloser, *url.URL, *packages_model.PackageFile, error) {
|
||||
@@ -617,7 +623,7 @@ func GetPackageBlobStream(ctx context.Context, pf *packages_model.PackageFile, p
|
||||
}
|
||||
}
|
||||
if u == nil {
|
||||
s, err = cs.Get(key)
|
||||
s, err = cs.OpenBlob(key)
|
||||
}
|
||||
|
||||
if err == nil {
|
||||
|
Reference in New Issue
Block a user