Organizational Research By

Surprising Reserch Topic

Experts Most Trusted Topic


enable cors on embedded jetty using -'jetty,embedded-jetty,swagger-ui'


enable cors on embedded jetty  using -'jetty,embedded-jetty,swagger-ui'

I am trying to enable CORS on Jetty using the following code but I think CORS is still not working. Please help

    FilterHolder holder = new FilterHolder(new CrossOriginFilter());
    holder.setInitParameter("Access-Control-Allow-Origin", "*");
    holder.setInitParameter("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT, PATCH, OPTIONS");
    holder.setInitParameter("Access-Control-Allow-Headers", "ontent-Type, api_key, Authorization");


    sch.addFilter(holder, "/*", EnumSet.of(DispatcherType.REQUEST));


when i do

$ curl -I "http://localhost:9000/api-docs/service.json"

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 428

    

asked Sep 7, 2015 by rajesh
0 votes
9 views



Related Hot Questions



Government Jobs Opening


...