can't compile assets on prod due to asset_host config && SSL requirement

My production asset_host config looks like this:

  config.action_controller.asset_host = { |source, request|
    if request.ssl?
      "#{request.protocol}assets#{(source.length % 4) +

...which is more or less straight from the docs:

When I go to assets:precompile, I get this:

$ RAILS_ENV=production bundle exec rake assets:precompile
rake aborted!
This asset host cannot be computed without a request in scope. Remove
the second argument to your asset_host Proc if you do not need the

....except that I can't really remove the 2nd arg because I need to
know if the request is ssl or not. That said, I understand that a
request isn't present during the rake task to generate the assets....

So how do I get out of this catch 22?