File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -50,8 +50,11 @@ export class GraphQLServerLambda {
50
50
51
51
graphqlHandler = ( event , context , callback ) => {
52
52
function callbackFilter ( error , output ) {
53
+ const headers = output . headers || { }
54
+ headers [ 'Access-Control-Allow-Origin' ] = '*'
55
+
53
56
// eslint-disable-next-line no-param-reassign
54
- output . headers [ 'Access-Control-Allow-Origin' ] = '*'
57
+ output . headers = headers
55
58
56
59
callback ( error , output )
57
60
}
@@ -61,7 +64,7 @@ export class GraphQLServerLambda {
61
64
if ( typeof t === 'boolean' ) {
62
65
return t
63
66
} else if ( t . mode === 'http-header' ) {
64
- return event . headers [ 'x-apollo-tracing' ] !== undefined
67
+ return event . headers && event . headers [ 'x-apollo-tracing' ] !== undefined
65
68
} else {
66
69
return t . mode === 'enabled'
67
70
}
You can’t perform that action at this time.
0 commit comments