From d0153fc8dc08c02784e094c18c2174484259086d Mon Sep 17 00:00:00 2001 From: Alain Bourgeois Date: Wed, 27 Dec 2023 12:12:08 +0100 Subject: [PATCH 1/5] Update lib/handlers/put.js Co-authored-by: Ted Thibodeau Jr --- lib/handlers/put.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/handlers/put.js b/lib/handlers/put.js index 168278a46..4979dc9c5 100644 --- a/lib/handlers/put.js +++ b/lib/handlers/put.js @@ -11,7 +11,7 @@ async function handler (req, res, next) { res.header('MS-Author-Via', 'SPARQL') const contentType = req.get('content-type') - // check if a folder or resource with same name exists + // check whether a folder or resource with same name exists try { const ldp = req.app.locals.ldp await ldp.checkItemName(req) From b348b4bcb13f1785e8266830fb4e06f460cfc282 Mon Sep 17 00:00:00 2001 From: Alain Bourgeois Date: Wed, 27 Dec 2023 12:12:18 +0100 Subject: [PATCH 2/5] Update lib/ldp.js Co-authored-by: Ted Thibodeau Jr --- lib/ldp.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ldp.js b/lib/ldp.js index c24cc12b0..72a586458 100644 --- a/lib/ldp.js +++ b/lib/ldp.js @@ -158,7 +158,7 @@ class LDP { extension = '' } - // allways return a valid URL. + // always return a valid URL. const resourceUrl = await ldp.getAvailableUrl(hostname, containerPath, { slug, extension, container }) debug.handlers('POST -- Will create at: ' + resourceUrl) From 8018f1f851b365c1d43a8bcebd15ea52982970f2 Mon Sep 17 00:00:00 2001 From: Alain Bourgeois Date: Wed, 27 Dec 2023 12:12:27 +0100 Subject: [PATCH 3/5] Update lib/ldp.js Co-authored-by: Ted Thibodeau Jr --- lib/ldp.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ldp.js b/lib/ldp.js index 72a586458..1a586eb9a 100644 --- a/lib/ldp.js +++ b/lib/ldp.js @@ -327,7 +327,7 @@ class LDP { } catch (err) { } } - // check if a document (or container) has the same name than a document (or container) + // check whether a document (or container) has the same name as another document (or container) async checkItemName (url) { let testName, testPath const { hostname, pathname } = this.resourceMapper._parseUrl(url) // (url.url || url) From 057157b785b0e4c9eecc827f26f86e5802292927 Mon Sep 17 00:00:00 2001 From: Alain Bourgeois Date: Wed, 27 Dec 2023 12:12:40 +0100 Subject: [PATCH 4/5] Update lib/ldp.js Co-authored-by: Ted Thibodeau Jr --- lib/ldp.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ldp.js b/lib/ldp.js index 1a586eb9a..a4bfc07a5 100644 --- a/lib/ldp.js +++ b/lib/ldp.js @@ -585,7 +585,7 @@ class LDP { let itemName = slug.endsWith(extension) || slug.endsWith(this.suffixAcl) || slug.endsWith(this.suffixMeta) ? slug : slug + extension try { - // check resource exists + // check whether resource exists const context = container ? '/' : '' await this.resourceMapper.mapUrlToFile({ url: (requestUrl + itemName + context) }) itemName = `${uuid.v1()}-${itemName}` From a99473db3b7685a0d113b5fda24a0999923e8f9b Mon Sep 17 00:00:00 2001 From: Alain Bourgeois Date: Wed, 27 Dec 2023 12:12:47 +0100 Subject: [PATCH 5/5] Update lib/ldp.js Co-authored-by: Ted Thibodeau Jr --- lib/ldp.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ldp.js b/lib/ldp.js index a4bfc07a5..b785d6e18 100644 --- a/lib/ldp.js +++ b/lib/ldp.js @@ -591,7 +591,7 @@ class LDP { itemName = `${uuid.v1()}-${itemName}` } catch (e) { try { - // check resource with same name exists + // check whether resource with same name exists const context = !container ? '/' : '' await this.resourceMapper.mapUrlToFile({ url: (requestUrl + itemName + context) }) itemName = `${uuid.v1()}-${itemName}`