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

undefined method `+@' for "":String #733

Closed
khiav223577 opened this issue Sep 10, 2021 · 5 comments
Closed

undefined method `+@' for "":String #733

khiav223577 opened this issue Sep 10, 2021 · 5 comments

Comments

@khiav223577
Copy link

Reproduction Steps

HTTParty.get('http://google.com/search', query: { search: 'httparty' }).parsed_response

Will get this error:

NoMethodError: undefined method `+@' for "":String
        from /home/khiav/.rvm/gems/ruby-2.2.10/gems/httparty-0.19.0/lib/httparty/hash_conversions.rb:31:in `normalize_param'
        from /home/khiav/.rvm/gems/ruby-2.2.10/gems/httparty-0.19.0/lib/httparty/hash_conversions.rb:19:in `block in to_params'
        from /home/khiav/.rvm/gems/ruby-2.2.10/gems/httparty-0.19.0/lib/httparty/hash_conversions.rb:19:in `each'
        from /home/khiav/.rvm/gems/ruby-2.2.10/gems/httparty-0.19.0/lib/httparty/hash_conversions.rb:19:in `map'
        from /home/khiav/.rvm/gems/ruby-2.2.10/gems/httparty-0.19.0/lib/httparty/hash_conversions.rb:19:in `to_params'
        from /home/khiav/.rvm/gems/ruby-2.2.10/gems/httparty-0.19.0/lib/httparty/request.rb:200:in `normalize_query'
        from /home/khiav/.rvm/gems/ruby-2.2.10/gems/httparty-0.19.0/lib/httparty/request.rb:266:in `query_string'
        from /home/khiav/.rvm/gems/ruby-2.2.10/gems/httparty-0.19.0/lib/httparty/request.rb:109:in `uri'
        from /home/khiav/.rvm/gems/ruby-2.2.10/gems/httparty-0.19.0/lib/httparty/request.rb:215:in `setup_raw_request'
        from /home/khiav/.rvm/gems/ruby-2.2.10/gems/httparty-0.19.0/lib/httparty/request.rb:143:in `perform'
        from /home/khiav/.rvm/gems/ruby-2.2.10/gems/httparty-0.19.0/lib/httparty.rb:613:in `perform_request'
        from /home/khiav/.rvm/gems/ruby-2.2.10/gems/httparty-0.19.0/lib/httparty.rb:527:in `get'
        from /home/khiav/.rvm/gems/ruby-2.2.10/gems/httparty-0.19.0/lib/httparty.rb:646:in `get'
        from (irb):2
        from /home/khiav/.rvm/rubies/ruby-2.2.10/bin/irb:11:in `<main>'
khiav223577 pushed a commit to khiav223577/max_exchange_api that referenced this issue Sep 10, 2021
@bethesque
Copy link

Also facing this issue.

bethesque added a commit to pact-foundation/pact_broker-client that referenced this issue Sep 27, 2021
@lacostej
Copy link

The unary + method was added in ruby 2.3.0.

https://docs.ruby-lang.org/en/2.3.0/String.html#method-i-2B-40

The string literal changes introduced in #711 make httparty compatible with ruby 2.3+.

@jnunemaker
Copy link
Owner

@lacostej thanks! I didn't even notice that little change sneak in. Would "".dup fix that and work fine with 2.0.0?

@lacostej
Copy link

Would "".dup fix that and work fine with 2.0.0?

yes

@jnunemaker
Copy link
Owner

Closed by 4416141

trammel pushed a commit to trammel/pact_broker-client that referenced this issue May 23, 2022
The original issue documented at jnunemaker/httparty#733 has been solved, and a fix released.
kevin-j-m added a commit to kevin-j-m/pact_broker-client that referenced this issue Jan 4, 2023
Given that jnunemaker/httparty#733 is
resolved, this removes the restriction to stay on the 0.18 minor version
of httparty.

Notably, the intent here is to allow for httparty to be updated in
light of this issue: GHSA-5pq7-52mg-hr42.

httparty 0.21.0 has been released with a fix for this issue.
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

4 participants