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

"no implicit conversion of URI::HTTPS into String" exception after upgrading to 1.12.0 #280

Open
lauratpa opened this issue Jan 5, 2023 · 4 comments · May be fixed by #281
Open

"no implicit conversion of URI::HTTPS into String" exception after upgrading to 1.12.0 #280

lauratpa opened this issue Jan 5, 2023 · 4 comments · May be fixed by #281

Comments

@lauratpa
Copy link

lauratpa commented Jan 5, 2023

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.

lauratpa added a commit to lauratpa/premailer-rails that referenced this issue Jan 5, 2023
@lauratpa lauratpa linked a pull request Jan 5, 2023 that will close this issue
@Rdx31
Copy link

Rdx31 commented Apr 12, 2023

Hello there 👋

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 !

@fphilipe
Copy link
Owner

I'm the sole owner of this. I'll get to it eventually. Thanks for your patience 😊

@tilthouse
Copy link

@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

@tilthouse
Copy link

In an effort to expedite this fix, I took the fix from @lauratpa and added tests.

#286

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 a pull request may close this issue.

4 participants