Skip to content

Commit

Permalink
Encode extra_params to handle spaces.
Browse files Browse the repository at this point in the history
For example, using get_all_monitors() with 'group_states' including the state 'no data' would result in a 400 error prior to this change.
  • Loading branch information
mknight-atl committed Oct 19, 2016
1 parent fd48f50 commit 13444cf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/dogapi/common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def prepare_params(extra_params, with_app_key)
params = { api_key: @api_key }
params[:application_key] = @application_key if with_app_key
params = extra_params.merge params unless extra_params.nil?
qs_params = params.map { |k, v| k.to_s + '=' + v.to_s }
qs_params = params.map { |k, v| CGI.escape(k.to_s) + '=' + CGI.escape(v.to_s) }
qs = '?' + qs_params.join('&')
qs
end
Expand Down

0 comments on commit 13444cf

Please sign in to comment.