diff --git a/lib/request.js b/lib/request.js index 7860c40bc..8aeffaf7d 100644 --- a/lib/request.js +++ b/lib/request.js @@ -96,7 +96,8 @@ module.exports = { */ get origin () { - return this.req.headers.origin || null + if (!this.host) return null + return `${this.protocol}://${this.host}` }, /**