Skip to content

Commit

Permalink
Initialize context.state sooner
Browse files Browse the repository at this point in the history
  • Loading branch information
krisstern committed Dec 24, 2022
1 parent 6134b3c commit 5c3e296
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ module.exports = class Application extends Emitter {
request.response = response
response.request = request
context.originalUrl = request.originalUrl = req.url
context.state = {}
context.state = Object.assign({}, context.state)
return context
}

Expand Down
1 change: 1 addition & 0 deletions lib/context.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ const proto = module.exports = {
request: this.request.toJSON(),
response: this.response.toJSON(),
app: this.app.toJSON(),
state: this.state,
originalUrl: this.originalUrl,
req: '<original node req>',
res: '<original node res>',
Expand Down

0 comments on commit 5c3e296

Please sign in to comment.