Enabling cors in dropwizard not working

后端 未结 4 1462
春和景丽
春和景丽 2020-12-28 16:23

I\'m working on a dropwizard application and js ui to interacte with the api. I need to load json data to update views but I have to enable cors in dropwizard before that.

4条回答
  •  -上瘾入骨i
    2020-12-28 16:37

    For me even after configuring the above, it was not working. Ultimately it turned out that i have to also allow cache-control headers.

    filter.setInitParameter("allowedHeaders",
    "Cache-Control,If-Modified-Since,Pragma,Content-Type,Authorization,X-Requested-With,Content-Length,Accept,Origin");
    

提交回复
热议问题