1
0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-24 21:15:51 +01:00

fix: Fix the prefix used to delete from s3 when unpublishing packages (#2243)

This commit is contained in:
Leonardo Metzger 2021-05-12 15:15:18 -03:00 committed by GitHub
parent a54c18c02a
commit 6b1a28deb8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 3 deletions

@ -0,0 +1,5 @@
---
'verdaccio-aws-s3-storage': patch
---
Fix the prefix used to delete from s3 when unpublishing packages

@ -172,7 +172,7 @@ export default class S3PackageManager implements ILocalPackageManager {
this.s3,
{
Bucket: this.config.bucket,
Prefix: `${this.packagePath}`,
Prefix: addTrailingSlash(this.packagePath),
},
function (err) {
if (err && is404Error(err as VerdaccioError)) {

@ -231,7 +231,7 @@ describe('S3PackageManager with mocked s3', function () {
expect(mockListObject).toHaveBeenCalledWith(
{
Bucket: 'test-bucket',
Prefix: 'testKeyPrefix/@company/test-package',
Prefix: 'testKeyPrefix/@company/test-package/',
},
expect.any(Function)
);
@ -270,7 +270,7 @@ describe('S3PackageManager with mocked s3', function () {
expect(mockListObject).toHaveBeenCalledWith(
{
Bucket: 'test-bucket',
Prefix: 'testKeyPrefix/customFolder/@company/test-package',
Prefix: 'testKeyPrefix/customFolder/@company/test-package/',
},
expect.any(Function)
);