JavaFX WebView disable Same origin policy (allow cross domain requests)

前端 未结 3 1007
悲哀的现实
悲哀的现实 2020-12-19 04:50

I\'m developing a JavaFX application that is mostly a glorified web page. It\'s a desktop application (it\'s no embedded into a web page) and it has a Web View for the main

3条回答
  •  庸人自扰
    2020-12-19 05:37

    Basically, javaFx has the issue which is coupled with CORS - https://javafx-jira.kenai.com/browse/RT-35868. Assuming that web services which you are using, have CORS enabled you can try the following approach:

    • System.setProperty("sun.net.http.allowRestrictedHeaders", "true")

    OR

    • java -Dsun.net.http.allowRestrictedHeaders=true

    Hope it will help you

提交回复
热议问题