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) {
151151 const val = await layer . handler ( event ) ;
152152
153153 // 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 } ;
156157 if ( options . onBeforeResponse ) {
157158 await options . onBeforeResponse ( event , _response ) ;
158159 }
@@ -166,7 +167,7 @@ export function createAppEventHandler(stack: Stack, options: AppOptions) {
166167 // Already handled
167168 if ( event . handled ) {
168169 if ( options . onAfterResponse ) {
169- await options . onAfterResponse ( event , _response ) ;
170+ await options . onAfterResponse ( event , undefined ) ;
170171 }
171172 return ;
172173 }
You can’t perform that action at this time.
0 commit comments