Skip to content

Commit

Permalink
fix: fix jwt contenttype check in rso userinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
pradishb committed Sep 27, 2024
1 parent 32a2e33 commit de2a776
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion league_client/rso/userinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ def get_userinfo(
)
res.raise_for_status()
# userinfo can be either jwt or json based on access token type
if res.headers["content-type"] == "application/jwt; charset=utf-8":
# riot server sends either application/jwt;charset=UTF-8 or
# application/jwt; charset=utf-8 for jwt tokens
if res.headers["content-type"].lower().startswith("application/jwt;"):
return res.text
return res.json()

0 comments on commit de2a776

Please sign in to comment.