File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
plugins/node/opentelemetry-instrumentation-aws-lambda/src Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -437,7 +437,9 @@ export class AwsLambdaInstrumentation extends InstrumentationBase<AwsLambdaInstr
437437
438438 private static _extractFullUrl ( event : any ) : string | undefined {
439439 // API gateway encodes a lot of url information in various places to recompute this
440-
440+ if ( ! event . headers ) {
441+ return undefined ;
442+ }
441443 // Helper function to deal with case variations (instead of making a tolower() copy of the headers)
442444 function findAny (
443445 event : any ,
@@ -449,7 +451,7 @@ export class AwsLambdaInstrumentation extends InstrumentationBase<AwsLambdaInstr
449451 const host = findAny ( event , 'host' , 'Host' ) ;
450452 const proto = findAny ( event , 'x-forwarded-proto' , 'X-Forwarded-Proto' ) ;
451453 const port = findAny ( event , 'x-forwarded-port' , 'X-Forwarded-Port' ) ;
452- if ( ! ( event . headers && ( event . path || event . rawPath ) && host && proto ) ) {
454+ if ( ! ( proto && host && ( event . path || event . rawPath ) ) ) {
453455 return undefined ;
454456 }
455457 let answer = proto + '://' + host ;
You can’t perform that action at this time.
0 commit comments