[ 
https://issues.apache.org/jira/browse/PHOENIX-6921?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17710049#comment-17710049
 ] 

ASF GitHub Bot commented on PHOENIX-6921:
-----------------------------------------

doojonio commented on code in PR #125:
URL: 
https://github.com/apache/phoenix-queryserver/pull/125#discussion_r1161410857


##########
python-phoenixdb/phoenixdb/__init__.py:
##########
@@ -56,7 +56,7 @@
 
 
 def connect(url, max_retries=None, auth=None, authentication=None, 
avatica_user=None, avatica_password=None,
-            truststore=None, verify=None, do_as=None, user=None, 
password=None, **kwargs):
+            truststore=None, verify=None, do_as=None, user=None, 
password=None, headers=None, **kwargs):

Review Comment:
   Done



##########
python-phoenixdb/phoenixdb/avatica/client.py:
##########
@@ -148,6 +148,7 @@ def __init__(self, url, max_retries=None, auth=None, 
verify=None):
         self.max_retries = max_retries if max_retries is not None else 3
         self.auth = auth
         self.verify = verify
+        self.headers = headers or {}

Review Comment:
   Done



##########
python-phoenixdb/phoenixdb/avatica/client.py:
##########
@@ -168,7 +169,7 @@ def _post_request(self, body, headers):
         if not self.session:
             logger.debug("Creating a new Session")
             self.session = requests.Session()
-            self.session.headers.update(headers)
+            self.session.headers.update({**self.headers, **headers})

Review Comment:
   Done





> Add support for custom http headers for phoenixdb
> -------------------------------------------------
>
>                 Key: PHOENIX-6921
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-6921
>             Project: Phoenix
>          Issue Type: New Feature
>          Components: python, queryserver
>            Reporter: Anton Fedotov
>            Priority: Critical
>
> Phoenix Query Server sometimes can be accessed through HTTP balancer which 
> uses HTTP headers to navigate the request from clients. Need to add custom 
> headers support to phoenixdb.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to