mirror of
https://github.com/go-gitea/gitea
synced 2025-07-09 12:07:20 +00:00
Fix handling of Debian files with trailing slash (#26087)
Fixes #26022 - Fix handling of files with trailing slash - Fix handling of duplicate package file errors - Added test for both
This commit is contained in:
@ -80,7 +80,9 @@ func ParsePackage(r io.Reader) (*Package, error) {
|
||||
|
||||
if strings.HasPrefix(hd.Name, controlTar) {
|
||||
var inner io.Reader
|
||||
switch hd.Name[len(controlTar):] {
|
||||
// https://man7.org/linux/man-pages/man5/deb-split.5.html#FORMAT
|
||||
// The file names might contain a trailing slash (since dpkg 1.15.6).
|
||||
switch strings.TrimSuffix(hd.Name[len(controlTar):], "/") {
|
||||
case "":
|
||||
inner = arr
|
||||
case ".gz":
|
||||
|
Reference in New Issue
Block a user