Skip to content

Commit

Permalink
优化代码,减少kv写入操作的使用量
Browse files Browse the repository at this point in the history
  • Loading branch information
cf-pages committed Jan 18, 2023
1 parent 0e5848c commit 20e714d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions functions/file/[id].js
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,13 @@ export async function onRequest(context) { // Contents of context object
}
}
//check if the env variables WhiteList_Mode are set
console.log("env.WhiteList_Mode:",env.WhiteList_Mode)
if (env.WhiteList_Mode=="true"){
//if the env variables WhiteList_Mode are set, redirect to the image
return Response.redirect(url.origin+"/whitelist-on.html", 302);
}else{
//if the env variables WhiteList_Mode are not set, redirect to the image
return response;
}
}

Expand Down

0 comments on commit 20e714d

Please sign in to comment.