Skip to content

Commit f520d8a

Browse files
fix(billing): default NODE_ENV to development in isAllowedUrl
When NODE_ENV is unset, isAllowedUrl rejected HTTP URLs in dev, blocking Stripe Checkout from localhost. Now defaults to 'development' matching the config loader behavior.
1 parent 18e819d commit f520d8a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

modules/billing/services/billing.service.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ const getStripe = () => {
3131
const isAllowedUrl = (url) => {
3232
try {
3333
const parsed = new URL(url);
34-
const allowHttp = process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test';
34+
const env = process.env.NODE_ENV || 'development';
35+
const allowHttp = env === 'development' || env === 'test';
3536
if (!allowHttp && parsed.protocol !== 'https:') return false;
3637
if (config.domain) {
3738
const configHost = new URL(config.domain.startsWith('http') ? config.domain : `https://${config.domain}`).hostname;

0 commit comments

Comments
 (0)