Skip to content

Commit cdc052d

Browse files
committed
remove debug console.log statements
1 parent 5a60c6f commit cdc052d

File tree

31 files changed

+0
-438
lines changed

31 files changed

+0
-438
lines changed

lib/ldp.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,8 @@ class LDP {
8888
async readResource (url) {
8989
try {
9090
const { path } = await this.resourceMapper.mapUrlToFile({ url })
91-
console.log('readResource path: ' + path)
9291
return await withLock(path, () => promisify(fs.readFile)(path, { encoding: 'utf8' }))
9392
} catch (err) {
94-
console.log('ldp readResource err: ' + err.message)
9593
throw error(err.status, err.message)
9694
}
9795
}
@@ -100,8 +98,6 @@ class LDP {
10098
if (url[url.length - 1] !== '/') {
10199
url += '/'
102100
}
103-
console.log('readContainerMeta url: ' + url)
104-
console.log('readContainerMeta url with suffix: ' + (url + this.suffixMeta))
105101
return this.readResource(url + this.suffixMeta)
106102
}
107103

@@ -243,10 +239,8 @@ class LDP {
243239
// all the time. So now we have to account for that, as done below.
244240
const hostname = typeof url !== 'string' ? url.hostname : URL.parse(url).hostname
245241
try {
246-
// console.log('resourceMapper: ' + this.resourceMapper)
247242
isOverQuota = await overQuota(this.resourceMapper.resolveFilePath(hostname), this.serverUri)
248243
} catch (err) {
249-
console.log(err)
250244
throw error(500, 'Error finding user quota')
251245
}
252246
if (isOverQuota) {
@@ -263,9 +257,7 @@ class LDP {
263257
contentType = 'text/turtle'
264258
}
265259

266-
console.log(contentType)
267260
const { path } = await this.resourceMapper.mapUrlToFile({ url, contentType, createIfNotExists: true })
268-
console.log('after map')
269261
// debug.handlers(container + ' item ' + (url.url || url) + ' ' + contentType + ' ' + path)
270262
// check if file exists, and in that case that it has the same extension
271263
if (!container) { await this.checkFileExtension(url, path) }
@@ -460,12 +452,10 @@ class LDP {
460452
async isOwner (webId, hostname) {
461453
// const ldp = req.app.locals.ldp
462454
const rootUrl = this.resourceMapper.resolveUrl(hostname)
463-
console.log('isOwner root url: ' + rootUrl)
464455
let graph
465456
try {
466457
// TODO check for permission ?? Owner is a MUST
467458
graph = await this.getGraph(rootUrl + '/.meta')
468-
console.log('isOwner graph: ' + graph)
469459
const SOLID = $rdf.Namespace('http://www.w3.org/ns/solid/terms#')
470460
const owner = await graph.statementsMatching($rdf.sym(webId), SOLID('account'), $rdf.sym(rootUrl + '/'))
471461
return owner.length

lib/resource-mapper.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ class ResourceMapper {
9292
// Will look for an index file if a folder is given and searchIndex is true
9393
async mapUrlToFile ({ url, contentType, createIfNotExists, searchIndex = true }) {
9494
// map contentType to mimeType part
95-
// console.log('content Type replace: ')
9695
contentType = contentType ? contentType.replace(/\s*;.*/, '') : ''
9796
// Parse the URL and find the base file path
9897
const { pathname, hostname } = this._parseUrl(url)

lib/utils.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -193,18 +193,15 @@ function routeResolvedFile (router, path, file, appendFileName = true) {
193193

194194
async function getQuota (root, serverUri) {
195195
const filename = path.join(root, 'settings/serverSide.ttl')
196-
console.log('getQuota filename : ' + filename)
197196
let prefs
198197
try {
199198
prefs = await _asyncReadfile(filename)
200199
} catch (error) {
201200
debug('Setting no quota. While reading serverSide.ttl, got ' + error)
202201
return Infinity
203202
}
204-
console.log('getQuota prefs: ' + prefs)
205203
const graph = $rdf.graph()
206204
const storageUri = serverUri.endsWith('/') ? serverUri : serverUri + '/'
207-
console.log('getQuota storageUri: ' + storageUri)
208205
try {
209206
$rdf.parse(prefs, graph, storageUri, 'text/turtle')
210207
} catch (error) {
@@ -220,15 +217,12 @@ async function getQuota (root, serverUri) {
220217
*/
221218

222219
async function overQuota (root, serverUri) {
223-
console.log('overQuota root + server Uri : ' + root + ' ' + serverUri)
224220
const quota = await getQuota(root, serverUri)
225-
console.log('overQuota quota: ' + quota)
226221
if (quota === Infinity) {
227222
return false
228223
}
229224
// TODO: cache this value?
230225
const size = await actualSize(root)
231-
console.log('overQuota size: ' + size)
232226
return (size > quota)
233227
}
234228

@@ -242,7 +236,6 @@ async function overQuota (root, serverUri) {
242236
*/
243237

244238
function actualSize (root) {
245-
console.log('actualSize root: ' + root)
246239
return util.promisify(getSize)(root)
247240
}
248241

test/resources/accounts-scenario/charlie/.acl

Lines changed: 0 additions & 10 deletions
This file was deleted.

test/resources/accounts-scenario/charlie/.well-known/.acl

Lines changed: 0 additions & 15 deletions
This file was deleted.
-4.19 KB
Binary file not shown.

test/resources/accounts-scenario/charlie/favicon.ico.acl

Lines changed: 0 additions & 15 deletions
This file was deleted.

test/resources/accounts-scenario/charlie/index.html

Lines changed: 0 additions & 47 deletions
This file was deleted.

test/resources/accounts-scenario/charlie/robots.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

test/resources/accounts-scenario/charlie/robots.txt.acl

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)