This project is archived and is in readonly mode.
compute_asset_host bombs when asset_host = Proc and called from a Mailer
-
Michael Koziarski
Can you also provide a test for actionmailer which shows the problem?
Would help avoid regressions and make the changeset a little more obvious.
-
Tekin
Yeah, sorry, had been a long day. Will get a proper patch in asap.
-
Tekin
Just looking into this a bit more, although it's still not right that compute_asset_host falls over in mailer templates when asset_host is set to a 2 arguement Proc, it seems the primary reason you'd use a Proc this way would be to provide an alternative host for SSL requests.
I'm just wondering, would it make more sense to be able to explicitly specify an optional SSL specific host?
config.action_controller.ssl_asset_host = "https://www.example.com"
That would certainly scratch my itch. What do you think?
-
Tekin
Here are some tests, including one that fails.
Although my patch fixes the problem, long term, I'm not convinced it's the right solution. The second argument was only really introduced to help deal with SSL:
http://dev.rubyonrails.org/ticke...
Long term, I think it make sense to depreciate this second parameter and add ssl_asset_host as an option to ActionController::Base. Unless there is a use case for the request arguement that I am missing?
-
Repository
- State changed from new to committed
(from [dab78e55cfcc111b898a1c2475c0c5c327db30f9]) Ensure ActionMailer doesn't blow up when a two argument proc is set for the asset host
Signed-off-by: Michael Koziarski michael@koziarski.com [#1394 compute_asset_host bombs when asset_host = Proc and called from a Mailer state:committed] http://github.com/rails/rails/co...
-
Tekin
Cheers. Much more concise!
