H Hamied Abou Hulaikah Well-Known Member Licensed User Longtime User Jan 5, 2022 #1 How can I enable CORS "Cross Origin Resource Share" in httpserver library? any function or java code?
How can I enable CORS "Cross Origin Resource Share" in httpserver library? any function or java code?
drgottjr Expert Licensed User Longtime User Jan 5, 2022 #2 this is a configuration matter. instructions to add support for apache, nginx, IIS, etc all involve adding such instructions to their configuration files. the same seems to be true for the jetty server (which is what i think you're using). those instructions are found here: https://pretagteam.com/question/how-to-add-accesscontrolalloworigin-to-jetty-server. see if you can figure out where it is on your server (and then edit it) or rebuild a new configuration file and install it. Upvote 0
this is a configuration matter. instructions to add support for apache, nginx, IIS, etc all involve adding such instructions to their configuration files. the same seems to be true for the jetty server (which is what i think you're using). those instructions are found here: https://pretagteam.com/question/how-to-add-accesscontrolalloworigin-to-jetty-server. see if you can figure out where it is on your server (and then edit it) or rebuild a new configuration file and install it.
aeric Expert Licensed User Longtime User Jan 6, 2022 #3 It can be added to jServer (jetty server) but I am not sure about httpserver library You can check Jetty Cross Origin Filter to be added to jServer library If it could be possible to add the org.eclipse.jetty.servlets.CrossOriginFilter to jServer library. We could handle it just like a a DoSFilter (AddCrossOriginFilter(Path As String, Settings As Map)) www.b4x.com or my Web API Template (look for ConfigureCORS sub) Upvote 0
It can be added to jServer (jetty server) but I am not sure about httpserver library You can check Jetty Cross Origin Filter to be added to jServer library If it could be possible to add the org.eclipse.jetty.servlets.CrossOriginFilter to jServer library. We could handle it just like a a DoSFilter (AddCrossOriginFilter(Path As String, Settings As Map)) www.b4x.com or my Web API Template (look for ConfigureCORS sub)
H Hamied Abou Hulaikah Well-Known Member Licensed User Longtime User Jan 6, 2022 #4 I want an approach from inside B4A, like inline java code or extending library itself. I tried this but not worked! B4X: Copy Response.SetHeader("Access-Control-Allow-Origin","*") Upvote 0
I want an approach from inside B4A, like inline java code or extending library itself. I tried this but not worked! B4X: Copy Response.SetHeader("Access-Control-Allow-Origin","*")