waibu 1.1.18 → 1.1.20

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waibu",
3
- "version": "1.1.18",
3
+ "version": "1.1.20",
4
4
  "description": "Web Framework for Bajo",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/plugin/factory.js CHANGED
@@ -136,6 +136,7 @@ async function factory (pkgName) {
136
136
  const { breakNsPath } = this.app.bajo
137
137
  const { ns, subNs = '', path } = breakNsPath(route)
138
138
  return find(this.routes, r => {
139
+ if (r.path.startsWith('*')) return false
139
140
  r.config = r.config ?? {}
140
141
  const match = outmatch(r.config.pathSrc ?? r.path, { separator: false })
141
142
  if (!match(path)) return false
@@ -272,6 +273,7 @@ async function factory (pkgName) {
272
273
  let url = info.path
273
274
  const langDetector = get(cfg, 'intl.detectors', [])
274
275
  if (info.ns) url = trimEnd(langDetector.includes('path') ? `/${params.lang ?? ''}${this.routeDir(info.ns)}${info.path}` : `${this.routeDir(info.ns)}${info.path}`, '/')
276
+ url = url.split('/').map(u => encodeURI(u)).join('/')
275
277
  info.qs = defaultsDeep({}, query, info.qs)
276
278
  if (!isEmpty(info.qs)) url += '?' + this.qs.stringify(info.qs)
277
279
  if (!url.startsWith('http') && guessHost) url = `http://${this.config.server.host}:${this.config.server.port}/${trimStart(url, '/')}`