You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Steve T (JIRA)" <ji...@apache.org> on 2016/02/06 17:58:39 UTC

[jira] [Updated] (PHOENIX-2661) CORS Support for Avatica Requests on Phoenix Query Server

     [ https://issues.apache.org/jira/browse/PHOENIX-2661?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Steve T updated PHOENIX-2661:
-----------------------------
    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 {color:blue}{{Origin:}}{color}) and methods (like {color:blue}{{method: OPTIONS}}{color}) 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 {color:blue}{{X-Requested-With}}{color} header in the request.
2.  One line code change in Avatica's {color:blue}{{AvaticaJsonHandler.handle()}}{color} to add an {color:blue}{{Access-Control-Allow-Origin: *}}{color} header to the response.

  was:
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 {color:blue}{{Origin:}}{color}) and methods (like {color:blue}{{method: OPTIONS}}{color}) 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 {color:blue}{{X-Requested-With}}{color} header in the request.
2.  One line code change in Avatica's {color:blue}{{AvaticaJsonHandler.handle()}}{color} to add an {color:blue}{{Origin: *}}{color} header to the response.


> CORS Support for Avatica Requests on Phoenix Query Server
> ---------------------------------------------------------
>
>                 Key: PHOENIX-2661
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-2661
>             Project: Phoenix
>          Issue Type: New Feature
>    Affects Versions: 4.6.0, 4.7.0
>            Reporter: Steve T
>            Priority: Minor
>
> 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 {color:blue}{{Origin:}}{color}) and methods (like {color:blue}{{method: OPTIONS}}{color}) 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 {color:blue}{{X-Requested-With}}{color} header in the request.
> 2.  One line code change in Avatica's {color:blue}{{AvaticaJsonHandler.handle()}}{color} to add an {color:blue}{{Access-Control-Allow-Origin: *}}{color} header to the response.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)