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

Easy perform returns url_malformat for valid URLs #216

Closed
zinahia opened this issue May 24, 2022 · 1 comment
Closed

Easy perform returns url_malformat for valid URLs #216

zinahia opened this issue May 24, 2022 · 1 comment

Comments

@zinahia
Copy link

zinahia commented May 24, 2022

Platform details

  • Mac OS Monterey 12.3.1. Chip: Apple M1 Max
  • Ruby version: 2.6.8
  • Curl: 7.79.1
  • Ethon version: 0.12.0

When running:

[1] pry(main)> easy = Ethon::Easy.new(url: "www.google.de")
[api] [grape] ETHON: Libcurl initialized
=> #<Ethon::Easy:0x0000000116704df8
 @body_write_callback=#<Proc:0x000000011670e4e8@/Users/redacted/.rbenv/versions/2.6.8/lib/ruby/gems/2.6.0/gems/ethon-0.12.0/lib/ethon/easy/callbacks.rb:38>,
 @debug_callback=#<Proc:0x000000011670e3a8@/Users/redacted/.rbenv/versions/2.6.8/lib/ruby/gems/2.6.0/gems/ethon-0.12.0/lib/ethon/easy/callbacks.rb:67>,
 @debug_info=#<Ethon::Easy::DebugInfo:0x000000011670e2b8 @messages=[]>,
 @handle=#<FFI::AutoPointer address=0x0000000124f32a00>,
 @header_write_callback=#<Proc:0x000000011670e448@/Users/redacted/.rbenv/versions/2.6.8/lib/ruby/gems/2.6.0/gems/ethon-0.12.0/lib/ethon/easy/callbacks.rb:53>,
 @headers_called=false,
 @response_body="",
 @response_headers="",
 @url="www.google.de">
[2] pry(main)> easy.perform
[api] [grape] ETHON: performed EASY effective_url= response_code= return_code=url_malformat total_time=
=> :url_malformat

This happens with any url (I have tried several from examples that work in other colleagues machines, linux ones).

If I tried the same with curl directly it works:

curl -I www.google.de
HTTP/1.1 200 OK
Content-Type: text/html; charset=ISO-8859-1
Date: Tue, 24 May 2022 10:21:05 GMT
Server: gws
X-XSS-Protection: 0
X-Frame-Options: SAMEORIGIN
Transfer-Encoding: chunked
Expires: Tue, 24 May 2022 10:21:05 GMT
Cache-Control: private
Set-Cookie: AEC=AakniGNqu_SY628gTzGB5hQb5YHaW0VLBivelqaOI9j8FiBBJCxR4xylsQ; expires=Sun, 20-Nov-2022 10:21:05 GMT; path=/; domain=.google.de; Secure; HttpOnly; SameSite=lax

The libcurl library seems to be the same:

[1] pry(main)> Ethon::Curl.version
=> "libcurl/7.79.1 SecureTransport (LibreSSL/3.3.5) zlib/1.2.11 nghttp2/1.45.1"
curl --version
curl 7.79.1 (x86_64-apple-darwin21.0) libcurl/7.79.1 (SecureTransport) LibreSSL/3.3.5 zlib/1.2.11 nghttp2/1.45.1
Release-Date: 2021-09-22
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet tftp 
Features: alt-svc AsynchDNS GSS-API HSTS HTTP2 HTTPS-proxy IPv6 Kerberos Largefile libz MultiSSL NTLM NTLM_WB SPNEGO SSL UnixSockets

One thing I noticed from the log message I get after executing easy.perform is that the effective_url is empty. Could it be something related to that? Also the fact that my chip is the M1 might be relevant.

ETHON: performed EASY effective_url= response_code= return_code=url_malformat total_time=

Any help is appreciated.

@zinahia
Copy link
Author

zinahia commented May 24, 2022

I finally fixed it by upgrading to version 0.15.0. I'm not sure exactly what was the PR that fixed it, perhaps this one: #180 but anyways, I guess it doesn't matter 😄 . Thanks anyways and sorry for the noise ✌️ .

@zinahia zinahia closed this as completed May 24, 2022
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

No branches or pull requests

1 participant