access-control-allow-origin on playframework

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-08 06:43:20

Check what your browser is trying to do, it may send an OPTION request first to check what is allowed, this is called "preflight request".

Also, setting Access-Control-Allow-Origin to * only works without credentials.

Using a custom router can solve this.

For example using: https://github.com/teamon/play-navigator

val rget = GET on "foo" to App.foo
val gpost = POST on "foo" to App.foo
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!