title: Paperclip is missing the Protocol (https) with Amazon S3
body: <p>In production.rb:</p>
  
  <pre><code>config.paperclip_defaults = {
      s3_host_name: "s3.#{ENV.fetch('AWS_REGION')}.amazonaws.com",
      storage: :s3,
      s3_credentials: {
          bucket: ENV.fetch('S3_BUCKET_NAME'),
          access_key_id: ENV.fetch('AWS_ACCESS_KEY_ID'),
          secret_access_key: ENV.fetch('AWS_SECRET_ACCESS_KEY'),
          s3_region: ENV.fetch('AWS_REGION'),
      }
  }
  </code></pre>
  
  <p>I don't have anything in the initializers/paperclip.rb.</p>
  
  <p>In my model:</p>
  
  <pre><code>class MyModel &lt; ApplicationRecord
    has_attached_file :photo, styles: {
        thumb: '100x100&gt;',
        square: '200x200#',
        medium: '300x300&gt;'
    }
    validates_attachment_content_type :photo, content_type: /\Aimage\/.*\Z/
    def photo_url=(url)
      self.photo = URI.parse(url)
    end
  end
  </code></pre>
  
  <p>And then I test it out:</p>
  
  <pre><code>m = Model.new
  m.photo_url = "https://s3.us-east-2.amazonaws.com/mybucket/sports-grill-miami.jpg"
  m.save!
  m.photo.url(:thumb)
  "//s3.us-east-2.amazonaws.com/mybucket/buckets/photos/000/000/005/thumb/sports-grill-miami.jpg?1495237443" 
  </code></pre>
  
  <p>Why is the HTTPS protocol missing? This is crashing my android application because it requires a protocol to connect to URL. Do I need to hardcode the URL or can Paperclip handle this?</p>