title: trouble with CORS on dropwizard and jquery
body: <p>Having trouble getting CORS to work with Dropwizard and jquery.</p>
  
  <p>Set up this on Dropwizard:</p>
  
  <pre><code>environment.addFilter(CrossOriginFilter.class, "*")
    .setInitParam("allowedOrigins", "*")
    .setInitParam("allowedHeaders", "X-Requested-With,Content-Type,Accept,Origin,Access-Control-Request-Method,Authorization,Access-Control-Request-Method")
    .setInitParam("allowedMethods", "OPTIONS,GET,PUT,POST,DELETE,HEAD");
  </code></pre>
  
  <p>and on the client side:</p>
  
  <pre><code>$.ajax({ // create an AJAX call...
                  beforeSend: function(xhr, settings) {
                      var csrftoken = getCookie('csrftoken');
                      xhr.setRequestHeader("X-CSRFToken", csrftoken);
                  },
                  data: {'taduID': taduId }, // get the form data
                  crossDomain: true,
                  type: 'POST',
                  url: 'http://0.0.0.0:8080/tadu/getTaduFromId?id' + taduId,
                  success: function(response) { // on success..
                      console.log(response);          
                  }
              });
              return false;
  </code></pre>
  
  <p>however getting this in chrome:</p>
  
  <pre><code>XMLHttpRequest cannot load http://0.0.0.0:8080/tadu/getTaduFromId?id94339742-4381-46f2-b004-38a2d73b68bf. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://127.0.0.1:8000' is therefore not allowed access. 
  </code></pre>
  
  <p>Here is request/response</p>
  
  <pre><code>Remote Address:0.0.0.0:8080
  Request URL:http://0.0.0.0:8080/tadu/getTaduFromId?id94339742-4381-46f2-b004-38a2d73b68bf
  Request Method:OPTIONS
  Status Code:204 No Content
  Request Headersview source
  Accept:*/*
  Accept-Encoding:gzip,deflate,sdch
  Accept-Language:en-US,en;q=0.8
  Access-Control-Request-Headers:accept, x-csrftoken, content-type
  Access-Control-Request-Method:POST
  Connection:keep-alive
  Host:0.0.0.0:8080
  Origin:http://127.0.0.1:8000
  Referer:http://127.0.0.1:8000/m/
  User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.116 Safari/537.36
  Query String Parametersview sourceview URL encoded
  id94339742-4381-46f2-b004-38a2d73b68bf:
  Response Headersview source
  Allow:OPTIONS,GET,HEAD
  Date:Wed, 30 Apr 2014 18:23:24 GMT
  </code></pre>
  
  <p>I'm sure there is a lot wrong here, but where to start? Have a hunch i've set up something wrong in Dropwizard</p>