Skip to content

Commit

Permalink
'update'
Browse files Browse the repository at this point in the history
  • Loading branch information
youfeed committed Jan 6, 2024
1 parent 5e0acfd commit ec38a10
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion functions/notify.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,11 @@ export async function onRequestPost(context) {
const secret = context.env.secret;
const request = context.request;
const timer = new Date().getTime() / 1000 >> 0;
const json = await request.text();
const json = await request.json();
const signature = request.headers.get("Signature");
const {signer,expire} = await AES_decrypt(secret,signature) ;
// AES_decrypt 需要try catch 包裹
return new Response(JSON.stringify(json),{headers:{'content-type':'application/json;charset=UTF-8'}})
if(signer === undefined){
return new Response(JSON.stringify({err:403,msg:'签名错误2'},null,2),{headers:{'content-type':'application/json;charset=UTF-8'}})
}
Expand Down

0 comments on commit ec38a10

Please sign in to comment.