@@ -98,14 +98,14 @@ describe('Webhooks', function() {
9898
9999 it ( 'should return true when the header contains a valid signature and ' +
100100 'the timestamp is within the tolerance' ,
101- function ( ) {
102- var header = generateHeaderString ( {
103- timestamp : ( Date . now ( ) / 1000 ) ,
104- } ) ;
105-
106- expect ( stripe . webhooks . signature . verifyHeader ( EVENT_PAYLOAD_STRING , header , SECRET , 10 ) ) . to . equal ( true ) ;
101+ function ( ) {
102+ var header = generateHeaderString ( {
103+ timestamp : ( Date . now ( ) / 1000 ) ,
107104 } ) ;
108105
106+ expect ( stripe . webhooks . signature . verifyHeader ( EVENT_PAYLOAD_STRING , header , SECRET , 10 ) ) . to . equal ( true ) ;
107+ } ) ;
108+
109109 it ( 'should return true when the header contains at least one valid signature' , function ( ) {
110110 var header = generateHeaderString ( {
111111 timestamp : ( Date . now ( ) / 1000 ) ,
@@ -118,13 +118,13 @@ describe('Webhooks', function() {
118118
119119 it ( 'should return true when the header contains a valid signature ' +
120120 'and the timestamp is off but no tolerance is provided' ,
121- function ( ) {
122- var header = generateHeaderString ( {
123- timestamp : 12345 ,
124- } ) ;
125-
126- expect ( stripe . webhooks . signature . verifyHeader ( EVENT_PAYLOAD_STRING , header , SECRET ) ) . to . equal ( true ) ;
121+ function ( ) {
122+ var header = generateHeaderString ( {
123+ timestamp : 12345 ,
127124 } ) ;
125+
126+ expect ( stripe . webhooks . signature . verifyHeader ( EVENT_PAYLOAD_STRING , header , SECRET ) ) . to . equal ( true ) ;
127+ } ) ;
128128 } ) ;
129129} ) ;
130130
0 commit comments