This is an automated email from the ASF dual-hosted git repository.

fokko pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg-python.git


The following commit(s) were added to refs/heads/main by this push:
     new 27b6fe7  rest: Set OAuth Content-Type header explicitly (#478)
27b6fe7 is described below

commit 27b6fe777b4913d58923c5fdad51dd8974e86e39
Author: Fokko Driesprong <[email protected]>
AuthorDate: Wed Feb 28 12:00:13 2024 +0100

    rest: Set OAuth Content-Type header explicitly (#478)
---
 pyiceberg/catalog/rest.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/pyiceberg/catalog/rest.py b/pyiceberg/catalog/rest.py
index ab3d22e..6b952ef 100644
--- a/pyiceberg/catalog/rest.py
+++ b/pyiceberg/catalog/rest.py
@@ -290,8 +290,9 @@ class RestCatalog(Catalog):
         else:
             client_id, client_secret = None, credential
         data = {GRANT_TYPE: CLIENT_CREDENTIALS, CLIENT_ID: client_id, 
CLIENT_SECRET: client_secret, SCOPE: CATALOG_SCOPE}
-        # Uses application/x-www-form-urlencoded by default
-        response = session.post(url=self.auth_url, data=data)
+        response = session.post(
+            url=self.auth_url, data=data, headers={**session.headers, 
"Content-type": "application/x-www-form-urlencoded"}
+        )
         try:
             response.raise_for_status()
         except HTTPError as exc:

Reply via email to