Skip to content

Commit

Permalink
add 'stack' property to REQUEST
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremydaly committed Jan 7, 2019
1 parent 34bb29b commit 125993b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ class REQUEST {
this.body = UTILS.parseBody(this.body)
}

// Init the stack reporter
this.stack = null

// Extract path from event (strip querystring just in case)
let path = UTILS.parsePath(this.path)

Expand Down Expand Up @@ -236,6 +239,9 @@ class REQUEST {
// Set the execution stack
this._stack = route.inherited.concat(route.stack)

// Set the stack reporter
this.stack = this._stack.map(x => x.name.trim() !== '' ? x.name : 'unnamed')

} else {
this.app._errorStatus = 405
throw new MethodError('Method not allowed',this.method,'/'+path.join('/'))
Expand Down

0 comments on commit 125993b

Please sign in to comment.