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

need to_s before blank? check in query param construction #12

Closed
scootklein opened this issue Apr 4, 2011 · 0 comments
Closed

need to_s before blank? check in query param construction #12

scootklein opened this issue Apr 4, 2011 · 0 comments

Comments

@scootklein
Copy link

json_stream.rb:298

it's possible that params get passed in as Fixnum or Boolean types that won't respond to blank? when iterating and constructing the query string. adding a to_s will prevent exceptions.

def params
  flat = {}
  @options[:params].merge!(:track => @options[:filters]) unless @options[:filters].blank?
  @options[:params].each do |param, val|
    next if val.to_s.empty?
    val = val.join(",") if val.respond_to?(:join)
    flat[escape(param)] = escape(val)
  end
  flat
end
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

2 participants