File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -996,20 +996,21 @@ describe("Replicate client", () => {
996996 } ) ;
997997
998998 test ( "Can be used to validate webhook" , async ( ) => {
999- const secret = "whsec_5WbX5kEWLlfzsGNjH64I8lOOqUB6e8FH" ;
1000-
999+ // Test case from https://github.com/svix/svix-webhooks/blob/b41728cd98a7e7004a6407a623f43977b82fcba4/javascript/src/webhook.test.ts#L190-L200
10011000 const request = new Request ( "http://test.host/webhook" , {
10021001 method : "POST" ,
10031002 headers : {
10041003 "Content-Type" : "application/json" ,
1005- "Webhook-ID" : "123 " ,
1006- "Webhook-Timestamp" : "1707329251 " ,
1004+ "Webhook-ID" : "msg_p5jXN8AQM9LWM0D4loKWxJek " ,
1005+ "Webhook-Timestamp" : "1614265330 " ,
10071006 "Webhook-Signature" :
1008- "v1,nSIlB+PQG9cA4fNl6ec/aOmwxZktHIR5L0ymA5/Cm3E =" ,
1007+ "v1,g0hM9SsE+OTPJTGt/tmIKtSyZlE3uFJELVlNIOLJ1OE =" ,
10091008 } ,
1010- body : `{event:"output",data:"Hello, world!" }` ,
1009+ body : `{"test": 2432232314 }` ,
10111010 } ) ;
10121011
1012+ const secret = "whsec_MfKQ9r8GKYqrTwjUPD8ILPZIo2LaLaSw" ;
1013+
10131014 const isValid = await validateWebhook ( request , secret ) ;
10141015 expect ( isValid ) . toBe ( true ) ;
10151016 } ) ;
You can’t perform that action at this time.
0 commit comments