From 966a008fc7d07ecaa7f206777032b57e0355c2dc Mon Sep 17 00:00:00 2001 From: Joseph Turner Date: Thu, 5 Oct 2023 21:53:28 -0700 Subject: [PATCH] Fix: Add Etag and Link headers on successful directory deletion --- index.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 72fb0db..ed7fced 100755 --- a/index.js +++ b/index.js @@ -485,7 +485,15 @@ export default async function makeHyperFetch ({ if (!didDelete) { return { status: 404, body: 'Not Found', headers: { [HEADER_CONTENT_TYPE]: MIME_TEXT_PLAIN } } } - return { status: 200 } + + const fullURL = new URL(pathname, drive.url).href + + const headers = { + ETag: `${drive.version}`, + Link: `<${fullURL}>; rel="canonical"` + } + + return { status: 200, headers } } const entry = await drive.entry(pathname)