title: Origin is therefore not allowed access. The response had HTTP status code 503 Response appear after CORS call
body: <p><strong>CORS setup with Spring MVC (JAVA APPLICATION)</strong></p>
  
  <pre><code>@Component
  @WebFilter(urlPatterns = {"/*"}, description = "CORS")
  public class SimpleCORSFilter implements Filter {
  
  public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
      HttpServletResponse response = (HttpServletResponse) res;
      response.setHeader("Access-Control-Allow-Origin", "*");
      response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE");
      response.setHeader("Access-Control-Max-Age", "86400");
      response.setHeader("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
      chain.doFilter(req, res);
  }
  
  public void init(FilterConfig filterConfig) {}
  
  public void destroy() {}
  
  }
  </code></pre>
  
  <p>I try to make a <strong>POST</strong> to my application and the post is running, but in the middle of the running, Y receive this error: </p>
  
  <blockquote>
    <p>XMLHttpRequest cannot load <a href="https://finaldomain/start/" rel="nofollow">https://finaldomain/start/</a>. No
    'Access-Control-Allow-Origin <a href="https://originDomain/" rel="nofollow">https://originDomain/</a>  header is present
    on the requested resource. Origin  is therefore not allowed access.
    The response had HTTP status code 503.</p>
  </blockquote>
  
  <p>My both applications are deployed in <strong>Heroku</strong> and the post is making with <strong>Angular</strong>.</p>
  
  <p><strong>Heroku Log:</strong></p>
  
  <blockquote>
    <p>2015-10-03T21:50:14.474181+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=POST path="/start/" host=finaldomain request_id=84f76fea-0226-43b0-898d-e753681d7622 fwd="190.1
    95.196.252" dyno=web.1 connect=1ms service=30000ms status=503 bytes=0</p>
  </blockquote>
  
  <p><strong><em>I investigate more and I learn that is a timeout of Heroku, anybody know how to change it?</em></strong></p>
  
  <p>Thanks!</p>