Skip to content

Commit

Permalink
Merge branch 'issue#1743' into 5.7.9-alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
bourgeoa committed Dec 27, 2023
2 parents 3e6db72 + 4860cbb commit a5d6011
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/handlers/put.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions lib/ldp.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -585,13 +585,13 @@ 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}`
} 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}`
Expand Down
2 changes: 1 addition & 1 deletion test/surface/run-solid-test-suite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ teardown || true
setup $1
waitForNss server
runTests webid-provider-tests v2.0.3
runTests solid-crud-tests v6.0.0
runTestsFromGit solid-crud-tests v6.0.0-issue#1743
waitForNss thirdparty
# runTests web-access-control-tests v7.1.0
runTestsFromGit web-access-control-tests patchAppendNewDocument
Expand Down

0 comments on commit a5d6011

Please sign in to comment.