Преглед на файлове

prevent attempting to set headers after we already sent respone (#25994)

GitOrigin-RevId: be9f63f4c6d86ccd7f55850d71f5f2564eab2f12
Jimmy Domagala-Tang преди 1 година
родител
ревизия
aee3909a5f
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 2 2
      services/web/app/src/Features/Subscription/SubscriptionController.js

+ 2 - 2
services/web/app/src/Features/Subscription/SubscriptionController.js

@@ -590,7 +590,7 @@ function recurlyCallback(req, res, next) {
         }
         }
         // if theres no restore point it could be a failed renewal, or no restore set. Either way it will be handled through dunning automatically
         // if theres no restore point it could be a failed renewal, or no restore set. Either way it will be handled through dunning automatically
         if (!lastSubscription || !lastSubscription?.planCode) {
         if (!lastSubscription || !lastSubscription?.planCode) {
-          res.sendStatus(200)
+          return res.sendStatus(200)
         }
         }
         SubscriptionHandler.revertPlanChange(
         SubscriptionHandler.revertPlanChange(
           eventData.transaction.subscription_id,
           eventData.transaction.subscription_id,
@@ -599,7 +599,7 @@ function recurlyCallback(req, res, next) {
             if (err) {
             if (err) {
               return next(err)
               return next(err)
             }
             }
-            res.sendStatus(200)
+            return res.sendStatus(200)
           }
           }
         )
         )
       }
       }