File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed
components/picqer/sources/common Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -55,15 +55,17 @@ export default {
5555 async run ( event ) {
5656 const { body } = event ;
5757 const signature = event ?. headers [ "x-picqer-signature" ] ;
58- const hash = CryptoJS . HmacSHA256 ( event . bodyRaw , this . secret ) ;
59- const hashBase64 = CryptoJS . enc . Base64 . stringify ( hash ) ;
58+ if ( signature ) {
59+ const hash = CryptoJS . HmacSHA256 ( event . bodyRaw , this . secret ) ;
60+ const hashBase64 = CryptoJS . enc . Base64 . stringify ( hash ) ;
6061
61- if ( hashBase64 !== signature ) {
62- this . http . respond ( {
63- status : 401 ,
64- body : "Unauthorized" ,
65- } ) ;
66- return ;
62+ if ( hashBase64 !== signature ) {
63+ this . http . respond ( {
64+ status : 401 ,
65+ body : "Unauthorized" ,
66+ } ) ;
67+ return ;
68+ }
6769 }
6870
6971 this . http . respond ( {
You can’t perform that action at this time.
0 commit comments