#17 ✓resolved
Seb

decompose_uri_query_into_hash has problem with empty strings

Reported by Seb | February 21st, 2008 @ 05:07 PM

Hi,

I have a problem with the named function, when I call ahn via

agi://url/?x=1&y=&z=2

I get

#

/usr/local/src/ahn/lib/adhearsion/voip/asterisk/commands.rb:20:in `inject'

/usr/local/src/ahn/lib/adhearsion/voip/call.rb:218:in `each'

I would have expected nil or "" for y.

A quick&dirty bugfix I did was

--- lib/adhearsion/voip/call.rb (revision 622)

+++ lib/adhearsion/voip/call.rb (working copy)

@@ -216,7 +216,9 @@

returning variables do

if variables[:request].query

variables[:query] = variables[:request].query.split('&').inject({}) do |query_string_parameters, key_value_pair|

  • parameter_name, parameter_value = *key_value_pair.match(/(.+)=(.+)/).captures
  • x=key_value_pair.match(/(.+)=(.+)/)
  • x=key_value_pair.match(/(.+)=/) if x.nil?
  • parameter_name, parameter_value = x.captures

query_string_parameters[parameter_name] = parameter_value

query_string_parameters

end

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Shared Ticket Bins

People watching this ticket

Pages