title: CORS doesn't work for different url
body: <p>I have small java application with rest api. It's deployed and available with url like <code>http://1.1.1.1:8080/rest</code>. Also I enabled CORS filter there and it works find. </p>
  
  <p>But also I would like to configure access to my api with url like "<a href="http://myhost.com/" rel="nofollow">http://myhost.com/</a>". In this case CORS filter stop working. </p>
  
  <p>Any ideas?</p>
  
  <p><br></p>
  
  <p><strong>UPD1</strong> <br>
  Available headers:</p>
  
  <pre><code>    response.setHeader("Access-Control-Allow-Origin", "*");
      response.setHeader("Access-Control-Allow-Methods", "POST, GET, PUT, DELETE");
      response.setHeader("Access-Control-Max-Age", "3600");
  </code></pre>
  
  <p><br></p>
  
  <p><strong>UPD2</strong> <br>
  Updated 'Access-Control-Allow-Headers':</p>
  
  <pre><code>        response.setHeader("Access-Control-Allow-Headers",
                      "x-requested-with, " +
                      "Content-Type, " +
                      "Host, " +
                      "User-Agent, " +
                      "Accept, " +
                      "Accept-Language, " +
                      "Accept-Encoding, " +
                      "Referer, " +
                      "Origin, " +
                      "Connection, " +
                      "Cache-Control");
  </code></pre>
  
  <p>Request:</p>
  
  <pre><code>GET /list HTTP/1.1
  Host: myhost.com
  User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Firefox/31.0
  Accept: */*
  Accept-Language: ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3
  Accept-Encoding: gzip, deflate
  Referer: http://mysecondhost.com/test.html
  Origin: http://mysecondhost.com
  Connection: keep-alive
  Cache-Control: max-age=0
  </code></pre>
  
  <p><br></p>
  
  <p><strong>UPD3</strong> <br>
  Looks like we have nginx there with the following headers configuration:</p>
  
  <pre><code>        add_header 'Access-Control-Allow-Methods' 'GET,POST,DELETE,OPTIONS';
          add_header 'Access-Control-Allow-Credentials' 'true';
          add_header 'Access-Control-Allow-Origin' '*';
          add_header 'Access-Control-Allow-Headers' 'WD-Since,WD-Start,WD-Direction,WD-Length,WD-Ids,Content-Type,WD-Client-Id';
          add_header 'Access-Control-Expose-Headers' 'WD-Total-Length,WD-Phone-Modal,WD-Client-Id,WD-Udid,WD-Need-More';
          proxy_cache off;
          proxy_set_header Host $host;
          proxy_set_header X-Real-IP $remote_addr;
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
          proxy_pass http://localhost:8080/rest/;
  </code></pre>
  
  <p><br></p>