premailer-rails
premailer-rails copied to clipboard
"no implicit conversion of URI::HTTPS into String" exception after upgrading to 1.12.0
After upgrading to 1.12.0 our code started to fail with:
TypeError: Failed to open TCP connection to https://fonts.googleapis.com/css?family=Open+Sans:400,700:80 (no implicit conversion of URI::HTTPS into String)
File /usr/local/lib/ruby/2.7.0/net/http.rb:960 in initialize
File /usr/local/lib/ruby/2.7.0/net/http.rb:960 in open
File /usr/local/lib/ruby/2.7.0/net/http.rb:960 in block in connect
File /usr/local/bundle/gems/timeout-0.3.1/lib/timeout.rb:189 in block in timeout
File /usr/local/bundle/gems/timeout-0.3.1/lib/timeout.rb:196 in timeout
File /usr/local/lib/ruby/2.7.0/net/http.rb:958 in connect
File /usr/local/lib/ruby/2.7.0/net/http.rb:943 in do_start
File /usr/local/lib/ruby/2.7.0/net/http.rb:932 in start
File /usr/local/lib/ruby/2.7.0/net/http.rb:476 in get_response
File /usr/local/lib/ruby/2.7.0/net/http.rb:458 in get
File /usr/local/bundle/gems/premailer-rails-1.12.0/lib/premailer/rails/css_loaders/network_loader.rb:9 in load
File /usr/local/bundle/gems/premailer-rails-1.12.0/lib/premailer/rails/css_helper.rb:47 in block in load_css
We are using ruby 2.7, so it seems that this change https://github.com/fphilipe/premailer-rails/pull/261/files now triggers the exception, since Net::HTTP for ruby 2.7 does not support headers.
Hello there :wave:
Any news about this issue ? @fphilipe could you take care of this issue .. or let us know which contributor can take care of it ?
Many thanks in advance for your help !
I'm the sole owner of this. I'll get to it eventually. Thanks for your patience 😊
@lauratpa's PR looks fine to me. What would be the hold up on just merging it? If it's lack of tests, please let me know and I can work on adding them
In an effort to expedite this fix, I took the fix from @lauratpa and added tests.
https://github.com/fphilipe/premailer-rails/pull/286