Android Question HTTPServer library enable CORS

Hamied Abou Hulaikah

Well-Known Member
Licensed User
Longtime User
How can I enable CORS "Cross Origin Resource Share" in httpserver library? any function or java code?
 

drgottjr

Expert
Licensed User
Longtime User
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

aeric

Expert
Licensed User
Longtime User
It can be added to jServer (jetty server) but I am not sure about httpserver library

You can check

or

my Web API Template (look for ConfigureCORS sub)
 
Upvote 0

Hamied Abou Hulaikah

Well-Known Member
Licensed User
Longtime User
I want an approach from inside B4A, like inline java code or extending library itself.
I tried this but not worked!
B4X:
Response.SetHeader("Access-Control-Allow-Origin","*")
 
Upvote 0
Top