Protocol relative URLs for API

I’m using carrierwave and serve upload files via Cloudfront:

CarrierWave.configure do |config| = :fog
  config.asset_host = ENV['ASSET_HOST_URL']  # //
end   # //

It works great for both http and https pages that render in browser, but in my app I also have JSON API endpoint ‘/v1/posts/1’ to response this post in JSON representation as well. And the consumer of this APIs are mobile app, so they don’t recognize this url to render the images.