ankane / ahoy_email

First-party email analytics for Rails
MIT License
1.11k stars 137 forks source link

Allow redirections to other/external hosts for click event #154

Closed kunal-bluebash closed 2 years ago

kunal-bluebash commented 2 years ago

Context While tracking mail using ahoy click it redirects user to external url using redirect_to.

Rails 7 requires to explicitly pass allow_other_host: true to redirect_to to allow such redirections. Otherwise, an ugly exception is raised.

Rails 7.01 Expected behaviour. When using ahoy with Rails 7 and redirecting user to external url, It will successfully redirected to that url.

Current behaviour. When using ahoy with Rails 7 and redirecting user to external url, a ActionController::Redirecting::UnsafeRedirectError is raised.

Solution: We can add allow_other_host: true in this controller

ankane commented 2 years ago

Hey @kunal-bluebash, thanks for reporting! Just pushed a new release.

StanBright commented 2 years ago

... some of us are stuck on v1.1.1 😭

BrVer commented 1 year ago

hey, migrating to >= 2.0 is painful for us, we had to postpone this process, is there any way this fix can be implemented on 1.1 ?