wiki-server 0.22.0 → 0.22.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/page.coffee CHANGED
@@ -338,11 +338,18 @@ module.exports = exports = (argv) ->
338
338
  cb null, sitemap.filter (item) -> if item? then true
339
339
 
340
340
  itself.slugs = (cb) ->
341
- fs.readdir argv.db, (e, files) ->
341
+ fs.readdir argv.db, {withFileTypes: true}, (e, files) ->
342
342
  if e
343
343
  console.log 'Problem reading pages directory', e
344
344
  cb(e)
345
345
  else
346
- cb(null, files)
346
+ onlyFiles = files.map((i) ->
347
+ if i.isFile()
348
+ return i.name
349
+ else
350
+ return null
351
+ ).filter((i) ->
352
+ i != null && !i?.startsWith('.'))
353
+ cb(null, onlyFiles)
347
354
 
348
355
  itself
package/lib/server.coffee CHANGED
@@ -588,12 +588,11 @@ module.exports = exports = (argv) ->
588
588
  fetch(requestURL, {timeout: 2000})
589
589
  .then (fetchRes) ->
590
590
  if fetchRes.ok
591
- return fetchRes
592
- throw new Error(fetchRes.statusText)
593
- .then (fetchRes) ->
594
- res.set('content-type', fetchRes.headers.get('content-type'))
595
- res.set('last-modified', fetchRes.headers.get('last-modified'))
596
- await pipeline(fetchRes.body, res)
591
+ res.set('content-type', fetchRes.headers.get('content-type'))
592
+ res.set('last-modified', fetchRes.headers.get('last-modified'))
593
+ await pipeline(fetchRes.body, res)
594
+ else
595
+ res.status(fetchRes.status).end()
597
596
  .catch (err) ->
598
597
  console.log("ERROR: Proxy Request ", requestURL, err)
599
598
  res.status(500).end()
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "wiki-server",
3
3
  "description": "A Federated Wiki Server",
4
- "version": "0.22.0",
4
+ "version": "0.22.2",
5
5
  "author": {
6
6
  "name": "Ward Cunningham",
7
7
  "email": "ward@c2.com",
@@ -51,7 +51,7 @@
51
51
  "mocha": "^10.2.0",
52
52
  "should": "^13.2.3",
53
53
  "supertest": "^6.3.3",
54
- "wiki-client": "^0.24.0",
54
+ "wiki-client": "^0.27.0",
55
55
  "wiki-plugin-activity": "^0.5.0",
56
56
  "wiki-plugin-video": "^0.3.0"
57
57
  },