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

fix: Improve handling of Redis URL #1235

Merged
merged 1 commit into from
Oct 12, 2024
Merged

Conversation

adamantike
Copy link
Collaborator

This change replaces the creation of Redis URL, from a simple string interpolation, to using yarl.URL. The main benefit, besides not forgetting to set all five different variables on every Redis client initialization, is that user credentials are correctly URL-encoded, if present.

Up until now, if a password had special characters, it could break the generated URL.

This change also introduces support for a REDIS_SSL setting, which allows the user to specify if the Redis connection should use SSL or not.

This change replaces the creation of Redis URL, from a simple string
interpolation, to using `yarl.URL`. The main benefit, besides not
forgetting to set all five different variables on every Redis client
initialization, is that user credentials are correctly URL-encoded, if
present.

Up until now, if a password had special characters, it could break the
generated URL.

This change also introduces support for a `REDIS_SSL` setting, which
allows the user to specify if the Redis connection should use SSL or not.
Copy link

Test Results

81 tests   81 ✅  24s ⏱️
 1 suites   0 💤
 1 files     0 ❌

Results for commit b81fbc5.

Copy link
Member

@gantoine gantoine left a comment

Choose a reason for hiding this comment

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

👏🏼

@adamantike adamantike merged commit ae9939d into master Oct 12, 2024
8 checks passed
@adamantike adamantike deleted the fix/improve-redis-url-handling branch October 12, 2024 16:17
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