Skip to content

Commit a6a2b69

Browse files
committed
Make public subscription API follow the 'enable public' setting.
1 parent 79ff729 commit a6a2b69

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

cmd/public.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,14 @@ func handleSubscriptionForm(c echo.Context) error {
482482
// handlePublicSubscription handles subscription requests coming from public
483483
// API calls.
484484
func handlePublicSubscription(c echo.Context) error {
485+
var (
486+
app = c.Get("app").(*App)
487+
)
488+
489+
if !app.constants.EnablePublicSubPage {
490+
return echo.NewHTTPError(http.StatusBadRequest, app.i18n.T("public.invalidFeature"))
491+
}
492+
485493
hasOptin, err := processSubForm(c)
486494
if err != nil {
487495
return err

0 commit comments

Comments
 (0)