waibu 1.2.5 → 1.2.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.
package/index.js CHANGED
@@ -22,7 +22,7 @@ async function factory (pkgName) {
22
22
  this.dependencies = ['bajo-logger', 'bajo-extra']
23
23
  this.config = {
24
24
  server: {
25
- address: '127.0.0.1',
25
+ host: '127.0.0.1',
26
26
  port: 7771
27
27
  },
28
28
  factory: {
@@ -188,7 +188,7 @@ async function factory (pkgName) {
188
188
  getOrigin = (req) => {
189
189
  const { isEmpty } = this.lib._
190
190
  let host = req.host
191
- if (isEmpty(host) || host === ':authority') host = `${this.config.server.address}:${this.config.server.port}`
191
+ if (isEmpty(host) || host === ':authority') host = `${this.config.server.host}:${this.config.server.port}`
192
192
  return `${req.protocol}://${host}`
193
193
  }
194
194
 
@@ -294,7 +294,7 @@ async function factory (pkgName) {
294
294
  if (options.uriEncoded) url = url.split('/').map(u => encodeURI(u)).join('/')
295
295
  info.qs = defaultsDeep({}, query, info.qs)
296
296
  if (!isEmpty(info.qs)) url += '?' + this.qs.stringify(info.qs)
297
- if (!url.startsWith('http') && guessHost) url = `http://${this.config.server.address}:${this.config.server.port}/${trimStart(url, '/')}`
297
+ if (!url.startsWith('http') && guessHost) url = `http://${this.config.server.host}:${this.config.server.port}/${trimStart(url, '/')}`
298
298
  return url
299
299
  }
300
300
 
@@ -11,7 +11,7 @@ async function handleForward (ctx) {
11
11
  }
12
12
  }
13
13
 
14
- const base = `http://${this.config.server.address}:${this.config.server.port}`
14
+ const base = `http://${this.config.server.host}:${this.config.server.port}`
15
15
  const options = defaultsDeep({ base }, this.config.forwardOpts)
16
16
  await ctx.register(replyFrom, options)
17
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waibu",
3
- "version": "1.2.5",
3
+ "version": "1.2.6",
4
4
  "description": "Web Framework for Bajo",
5
5
  "main": "index.js",
6
6
  "scripts": {