Skip to content

Handle empty string as token value#640

Merged
anakinj merged 1 commit into
jwt:mainfrom
ragalie:handle-empty-string-as-token
Dec 13, 2024
Merged

Handle empty string as token value#640
anakinj merged 1 commit into
jwt:mainfrom
ragalie:handle-empty-string-as-token

Conversation

@ragalie

@ragalie ragalie commented Dec 12, 2024

Copy link
Copy Markdown
Contributor

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
@anakinj

anakinj commented Dec 13, 2024

Copy link
Copy Markdown
Member

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