Skip to content

Modules: Convert SSL default option to Boolean in several modules #20298

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bcoles
Copy link
Contributor

@bcoles bcoles commented Jun 10, 2025

A quick search through the library code reveals several instances (before I stopped looking) where using a string literal may result in unexpected behavior, as a value of 'False' or 'false' evaluates to true. I'm not sure if these code paths would be hit by the affected modules (because I didn't look); regardless, we should be consistent with other modules.

proto = (datastore["SSL"] ? "https" : "http")

proto = (datastore['SSL'] ? "https" : "http")

ssl = datastore['SSL']
schema = ssl ? 'https' : 'http'

irb(main):001> 'False' ? true : false
(irb):1: warning: string literal in condition
=> true

ssl = !!(datastore["SSL"])
proto = (ssl ? "https://" : "http://")

irb(main):001> !!'False'
=> true

@bcoles bcoles added the code quality Improving code quality label Jun 10, 2025
@msutovsky-r7 msutovsky-r7 self-assigned this Jun 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code quality Improving code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants