Skip to content

Fix web push subscription endpoint URL - #229

Draft
yissachar wants to merge 1 commit into
block:mainfrom
yissachar:notification-subscription-post
Draft

yissachar wants to merge 1 commit into
block:mainfrom
yissachar:notification-subscription-post

Conversation

@yissachar

Copy link
Copy Markdown

Summary

  • Generate the Web Push subscription endpoint URL from the Rails route helper.
  • Pass that URL to the browser in a meta tag so subscription POST and DELETE requests follow the engine mount and /_ route scope.

Problem

The browser derived /web_push/subscription from the service worker URL, while the engine route is /_/web_push/subscription. Enabling notifications therefore returned 404.

Verification

  • git diff --check
  • Tests not run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant