title: Access-Control-Allow-Origin at heroku seems like not work
body: <p>I have a sinatra app at <strong>heroku</strong> and can't make it </p>
  
  <pre><code>get '/fdsfdsfd' do
    uri = URI.parse('https://fdsfdsfds')
    http = Net::HTTP.new(uri.host, uri.port)
    http.use_ssl = true
    req = Net::HTTP::Get.new(uri.request_uri)
    res = http.request(req)
  
    # headers['Access-Control-Allow-Origin'] = '*'
    # headers['Access-Control-Allow-Methods'] = "GET, POST, PUT, DELETE, OPTIONS"
    # headers['Access-Control-Allow-Headers'] ="accept, authorization, origin"
  
    response['Access-Control-Allow-Origin'] = '*'
    response['Access-Control-Allow-Methods'] = "GET, POST, PUT, DELETE, OPTIONS"
    response['Access-Control-Allow-Headers'] ="accept, authorization, origin"
  
    res.body
  
  end
  </code></pre>
  
  <p>Inspecting a response, it see that the header <code>Access-Control-Allow-Origin</code> exists, but <strong>yet</strong> making an ajax request from my javascript script, I get an error:</p>
  
  <pre><code>XMLHttpRequest cannot load `https://fdsfdsfds`. 
  Response to preflight request doesn't pass access control check: 
  No 'Access-Control-Allow-Origin' header is present on the requested resource.
  </code></pre>
  
  <p>Maybe it's the issue of heroku? Or what am I doing wrong?</p>
  
  <p>UPDATE:</p>
  
  <p>And here's a log from curl (partially):</p>
  
  <pre><code>&gt; GET /something HTTP/1.1
  &gt; User-Agent: curl/7.35.0
  &gt; Host: something.com
  &gt; Accept: */*
  &gt; 
  &lt; HTTP/1.1 200 OK 
  &lt; Connection: keep-alive
  &lt; Content-Type: text/html;charset=utf-8
  &lt; Access-Control-Allow-Origin: *
  &lt; Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
  &lt; Access-Control-Allow-Headers: accept, authorization, origin
  &lt; Content-Length: 2638
  &lt; X-Xss-Protection: 1; mode=block
  &lt; X-Content-Type-Options: nosniff
  &lt; X-Frame-Options: SAMEORIGIN
  * Server WEBrick/1.3.1 (Ruby/2.2.4/2015-12-16) is not blacklisted
  &lt; Server: WEBrick/1.3.1 (Ruby/2.2.4/2015-12-16)
  &lt; Date: Fri, 26 Feb 2016 12:51:09 GMT
  &lt; Via: 1.1 vegur
  &lt;
  ....body
  </code></pre>