File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
supabase/functions/webhook-aws-ses-notifications Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -233,7 +233,10 @@ async function verifySnsSignature(message: SnsMessage): Promise<boolean> {
233233 const host = certUrl . host . toLowerCase ( ) ;
234234 if ( ! certUrl . protocol . startsWith ( "https" ) ) return false ;
235235 if ( ! host . endsWith ( "amazonaws.com" ) ) return false ;
236- if ( ! certUrl . pathname . includes ( "/sns." ) ) return false ;
236+ const path = certUrl . pathname . toLowerCase ( ) ;
237+ const isLegacy = path . includes ( "/sns." ) ;
238+ const isCurrent = path . includes ( "simplenotificationservice-" ) ;
239+ if ( ! isLegacy && ! isCurrent ) return false ;
237240
238241 const certPem = await fetch ( certUrl . toString ( ) ) . then ( ( res ) => res . text ( ) ) ;
239242 const certBytes = pemToArrayBuffer ( certPem ) ;
You can’t perform that action at this time.
0 commit comments