Skip to content

Commit

Permalink
rest: Set OAuth Content-Type header explicitly (#478)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fokko authored Feb 28, 2024
1 parent a1099d8 commit 27b6fe7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pyiceberg/catalog/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,9 @@ def _fetch_access_token(self, session: Session, credential: str) -> str:
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:
Expand Down

0 comments on commit 27b6fe7

Please sign in to comment.