Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle empty string as token value #640

Merged
merged 1 commit into from
Dec 13, 2024

Conversation

ragalie
Copy link
Contributor

@ragalie ragalie commented Dec 12, 2024

Description

If the token is the empty string we try to pass nil to Base64.url_decode, which always expects a string.

This ensures we always pass a string to avoid an unexpected error.

Checklist

Before the PR can be merged be sure the following are checked:

  • There are tests for the fix or feature added/changed
  • A description of the changes and a reference to the PR has been added to CHANGELOG.md. More details in the CONTRIBUTING.md

If the token is the empty string we try to pass `nil` to `Base64.url_decode`,
which always expects a string.

This ensures we always pass a string to avoid an unexpected error.
@ragalie ragalie force-pushed the handle-empty-string-as-token branch from 2bf6a2a to 3b17ccb Compare December 12, 2024 14:20
@anakinj anakinj merged commit b006395 into jwt:main Dec 13, 2024
34 checks passed
@anakinj
Copy link
Member

anakinj commented Dec 13, 2024

Nice, thanks for the fix @ragalie

@ragalie ragalie deleted the handle-empty-string-as-token branch December 13, 2024 13:33
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.

2 participants