Skip to content

Commit 27b6fe7

Browse files
authored
rest: Set OAuth Content-Type header explicitly (#478)
1 parent a1099d8 commit 27b6fe7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pyiceberg/catalog/rest.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,9 @@ def _fetch_access_token(self, session: Session, credential: str) -> str:
290290
else:
291291
client_id, client_secret = None, credential
292292
data = {GRANT_TYPE: CLIENT_CREDENTIALS, CLIENT_ID: client_id, CLIENT_SECRET: client_secret, SCOPE: CATALOG_SCOPE}
293-
# Uses application/x-www-form-urlencoded by default
294-
response = session.post(url=self.auth_url, data=data)
293+
response = session.post(
294+
url=self.auth_url, data=data, headers={**session.headers, "Content-type": "application/x-www-form-urlencoded"}
295+
)
295296
try:
296297
response.raise_for_status()
297298
except HTTPError as exc:

0 commit comments

Comments
 (0)