File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -151,8 +151,9 @@ export function createAppEventHandler(stack: Stack, options: AppOptions) {
151
151
const val = await layer . handler ( event ) ;
152
152
153
153
// 5. Try to handle return value
154
- const _response = val === undefined ? undefined : { body : await val } ;
155
- if ( _response !== undefined ) {
154
+ const _body = val === undefined ? undefined : await val ;
155
+ if ( _body !== undefined ) {
156
+ const _response = { body : _body } ;
156
157
if ( options . onBeforeResponse ) {
157
158
await options . onBeforeResponse ( event , _response ) ;
158
159
}
@@ -166,7 +167,7 @@ export function createAppEventHandler(stack: Stack, options: AppOptions) {
166
167
// Already handled
167
168
if ( event . handled ) {
168
169
if ( options . onAfterResponse ) {
169
- await options . onAfterResponse ( event , _response ) ;
170
+ await options . onAfterResponse ( event , undefined ) ;
170
171
}
171
172
return ;
172
173
}
You can’t perform that action at this time.
0 commit comments