Skip to content

Commit

Permalink
fix(worker.js): fixed a bug which caused that env variabled were not …
Browse files Browse the repository at this point in the history
…accessible
  • Loading branch information
adshrc authored Sep 27, 2024
1 parent d3725a1 commit 01da53e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

export default {
async fetch(request) {
// Stripe Webhook IPs
// Stripe Webhook IPs (https://stripe.com/files/ips/ips_webhooks.txt)
const allowedIPs = [
'3.18.12.63',
'3.130.192.231',
Expand Down Expand Up @@ -63,8 +63,8 @@ export default {
const headers = new Headers(requestClone.headers);

// Check if both environment variables are set and add headers if they are
const clientId = env('CF_ACCESS_CLIENT_ID');
const clientSecret = env('CF_ACCESS_CLIENT_SECRET');
const clientId = env.CF_ACCESS_CLIENT_ID;
const clientSecret = env.CF_ACCESS_CLIENT_SECRET;

if (clientId && clientSecret) {
headers.set('CF-Access-Client-Id', clientId);
Expand Down

0 comments on commit 01da53e

Please sign in to comment.