Skip to content

Commit

Permalink
patch
Browse files Browse the repository at this point in the history
  • Loading branch information
lbr38 committed Oct 26, 2023
1 parent a9805ff commit 8b0c699
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions www/controllers/Repo/Package.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@

class Package
{
private $validMimeTypes = array(
'application/x-rpm',
'application/vnd.debian.binary-package',
);

/**
* Upload package to repo
*/
Expand Down Expand Up @@ -163,12 +158,11 @@ public function upload(int $snapId, $packages)
}

/**
* Check that the package has a valid Mime type
* Check that the package is valid
*/
if (!in_array(mime_content_type($packageTmpName), $this->validMimeTypes)) {
if ($packageType !== 'application/x-rpm' and $packageType !== 'application/vnd.debian.binary-package') {
$uploadError++;
$packageInvalid[] = $packageName;
continue;
}

/**
Expand Down Expand Up @@ -326,4 +320,4 @@ public function delete(int $snapId, array $packages)

return $deletedPackages;
}
}
}

0 comments on commit 8b0c699

Please sign in to comment.