Details
-
New Feature
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
None
-
None
-
None
Description
It would be super cool if I could write Javascript in a web page to read/write my Phoenix tables. I spend the last few days learning about CORS and browser security. I found out that what I am trying to accomplish cannot be readily done because the browser adds CORS headers (like Origin: <whatever>) and methods (like method: OPTIONS) that are not supported by Phoenix Query Server.
I do not know if this can be added on the Phoenix side or if it has to be added on the Avatica side, but for the time being I am trying the following to make it work:
1. Unconventional Javascript to remove the X-Requested-With header in the request.
2. One line code change in Avatica's AvaticaJsonHandler.handle() to add an Access-Control-Allow-Origin: * header to the response.