@@ -337,6 +337,10 @@ func (api *API) putUserNotificationPreferences(rw http.ResponseWriter, r *http.R
337
337
func (api * API ) postUserWebpushSubscription (rw http.ResponseWriter , r * http.Request ) {
338
338
ctx := r .Context ()
339
339
user := httpmw .UserParam (r )
340
+ if ! api .Experiments .Enabled (codersdk .ExperimentWebPush ) {
341
+ httpapi .ResourceNotFound (rw )
342
+ return
343
+ }
340
344
341
345
var req codersdk.WebpushSubscription
342
346
if ! httpapi .Read (ctx , rw , r , & req ) {
@@ -382,6 +386,11 @@ func (api *API) deleteUserWebpushSubscription(rw http.ResponseWriter, r *http.Re
382
386
ctx := r .Context ()
383
387
user := httpmw .UserParam (r )
384
388
389
+ if ! api .Experiments .Enabled (codersdk .ExperimentWebPush ) {
390
+ httpapi .ResourceNotFound (rw )
391
+ return
392
+ }
393
+
385
394
var req codersdk.DeleteWebpushSubscription
386
395
if ! httpapi .Read (ctx , rw , r , & req ) {
387
396
return
@@ -414,6 +423,11 @@ func (api *API) postUserPushNotificationTest(rw http.ResponseWriter, r *http.Req
414
423
ctx := r .Context ()
415
424
user := httpmw .UserParam (r )
416
425
426
+ if ! api .Experiments .Enabled (codersdk .ExperimentWebPush ) {
427
+ httpapi .ResourceNotFound (rw )
428
+ return
429
+ }
430
+
417
431
if err := api .WebpushDispatcher .Dispatch (ctx , user .ID , codersdk.WebpushMessage {
418
432
Title : "It's working!" ,
419
433
Body : "You've subscribed to push notifications." ,
0 commit comments