substrakt / letsencrypt-heroku

Make any Heroku application secure in just a couple of minutes.
https://substrakt.com/heroku-ssl-me-weve-come-a-long-way/
MIT License
524 stars 19 forks source link

'truthiness' not working properly here #22

Closed johnnagro closed 7 years ago

johnnagro commented 7 years ago

Hey. I am super excited about this project - it has the potential to make my life a lot easier, I'm more than willing / eager to contribute.

I've found an issue, for me this line always returns the staging endpoint regardless of if @debug is set to 0 or 1.

https://github.com/substrakt/letsencrypt-heroku/blob/master/lib/certificate_generation.rb#L124

I verified it in IRB using ruby 1.9 and 2.2 by simply:

irb(main):001:0> @debug = 0
=> 0
irb(main):002:0> @debug ? 'https://acme-staging.api.letsencrypt.org/' : 'https://acme-v01.api.letsencrypt.org/'
=> "https://acme-staging.api.letsencrypt.org/"
irb(main):003:0> @debug = 1
=> 1
irb(main):004:0> @debug ? 'https://acme-staging.api.letsencrypt.org/' : 'https://acme-v01.api.letsencrypt.org/'
=> "https://acme-staging.api.letsencrypt.org/"

Whats up with that?

johnnagro commented 7 years ago

thanks everyone