Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

decompose_uri_query_into_hash has problem with empty strings

#17

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

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

State: resolved
Milestone: none
Assigned to: Jay Phillips Jay Phillips

Activity

  1. Jay Phillips
    Jay Phillips
    • State changed from new to resolved

    December 7th, 2008 @ 09:39 PM

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.