Skip to content

Comments

Ability to parse JWT UserInfo payload#549

Merged
escattone merged 3 commits intomozilla:mainfrom
betagouv:fix-jwt-payload
Dec 16, 2025
Merged

Ability to parse JWT UserInfo payload#549
escattone merged 3 commits intomozilla:mainfrom
betagouv:fix-jwt-payload

Conversation

@ikarius
Copy link
Contributor

@ikarius ikarius commented Mar 31, 2025

A possible fix for #548 + simple content-type test

@ikarius
Copy link
Contributor Author

ikarius commented Apr 11, 2025

Mmm, e2e testing is failing, but it does not seem to be code related :

    raise DriverNotFoundError(f"Driver for {driver_name} was not found.")
splinter.exceptions.DriverNotFoundError: Driver for firefox was not found.
``

Copy link

@qbey qbey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙏

)
user_response.raise_for_status()

if user_response.headers.get("content-type", "").startswith("application/jwt"):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MIME types are case-insensitive you may want to be also?

MIME types are case-insensitive but are traditionally written in lowercase. The parameter values can be case-sensitive.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/MIME_types

Suggested change
if user_response.headers.get("content-type", "").startswith("application/jwt"):
if user_response.headers.get("content-type", "").lower().startswith("application/jwt"):

@escattone escattone merged commit 0495149 into mozilla:main Dec 16, 2025
5 of 17 checks passed
escattone added a commit that referenced this pull request Dec 17, 2025
escattone added a commit that referenced this pull request Dec 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants