From 52dde04c6d6f5daeac6dda9685740d02614ca5ce Mon Sep 17 00:00:00 2001 From: Cole Bosmann Date: Fri, 10 Nov 2023 17:01:24 -0800 Subject: [PATCH 1/2] fix: successful delete returns 204 --- src/store.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/store.ts b/src/store.ts index 20ea4f2..f4858a3 100644 --- a/src/store.ts +++ b/src/store.ts @@ -76,7 +76,7 @@ export class Store { async delete(key: string) { const res = await this.client.makeRequest({ key, method: HTTPMethod.DELETE, storeName: this.name }) - if (![200, 202, 404].includes(res.status)) { + if (![200, 204, 404].includes(res.status)) { throw new BlobsInternalError(res.status) } } From cc5fd6292e94b3321f733bc4b7a919d56d0d300f Mon Sep 17 00:00:00 2001 From: Cole Bosmann Date: Fri, 10 Nov 2023 17:05:18 -0800 Subject: [PATCH 2/2] fix: tests --- src/main.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.test.ts b/src/main.test.ts index 179fef8..ce5fa59 100644 --- a/src/main.test.ts +++ b/src/main.test.ts @@ -1138,7 +1138,7 @@ describe('delete', () => { test('Deletes from the blob store', async () => { const mockStore = new MockFetch().delete({ headers: { authorization: `Bearer ${edgeToken}` }, - response: new Response(null, { status: 202 }), + response: new Response(null, { status: 204 }), url: `${edgeURL}/${siteID}/production/${key}`, })