waibu 1.0.4 → 1.0.6

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.
@@ -6,8 +6,8 @@ function routePath (name = '', { query = {}, base = 'waibuMpa', params = {}, gue
6
6
  const plugin = getPlugin(base)
7
7
  const cfg = plugin.config ?? {}
8
8
  let info = {}
9
- if (name.startsWith('mailto:')) return name
10
- if (['.', '/', '?', '#'].includes(name[0]) || name.slice(1, 2) === ':') info.path = name
9
+ if (name.startsWith('mailto:') || name.startsWith('tel:')) return name
10
+ if (['%', '.', '/', '?', '#'].includes(name[0]) || name.slice(1, 2) === ':') info.path = name
11
11
  else if (['~'].includes(name[0])) info.path = name.slice(1)
12
12
  else {
13
13
  info = breakNsPath(name)
@@ -31,7 +31,7 @@
31
31
  "Too Many Requests": "",
32
32
  "Request Header Fields Too Large": "",
33
33
  "Unavailable For Legal Reasons": "",
34
- "Internal Server Error": "",
34
+ "Internal Server Error": "Kesalahan Internal Server",
35
35
  "Not Implemented": "",
36
36
  "Bad Gateway": "",
37
37
  "Service Unavailable": "",
@@ -6,9 +6,9 @@ async function errorHandler (ctx, extHandler) {
6
6
  reply.send(err.print)
7
7
  return
8
8
  }
9
- if (me.app.bajo.config.log.level === 'trace' && !['notFound', 'redirect'].includes(err.message)) console.error(err)
9
+ if (me.app.bajo.config.log.level === 'trace' && !['notfound', 'redirect'].includes(err.message.toLowerCase())) console.error(err)
10
10
  if (extHandler) return await extHandler.call(me, err, req, reply, ctx)
11
- if (err.message === 'notFound' || err.statusCode === 404) {
11
+ if (err.message.toLowerCase() === 'notfound' || err.statusCode === 404) {
12
12
  reply.code(err.statusCode)
13
13
  return
14
14
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waibu",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "Web Framework for Bajo",
5
5
  "main": "index.js",
6
6
  "scripts": {