Subject: | The "param" call returns all params when the parameter is missing |
Looking for any parameter which is not present in the "param" hash
returns the entire hash rather than undef or an empty string (see
example below). I do not think this properly mimics the A2::Request
object's behavior.
DB<1> x $request
0 Apache2::FakeRequest=HASH(0x3e578b0)
'as_string' => 'POST /o/744 HTTP/1.1
Host: nn2.deasil.com:7000
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.16)
Gecko/20110423 Gentoo Firefox/3.6.16
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
X-Requested-With: XMLHttpRequest
Referer: http://nn2.deasil.com:7000/
Content-Length: 453
Cookie: __utmc=31815649;
__utma=31815649.1206902665.1305656423.1305736495.1305742444.5;
__utmz=31815649.1305656423.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=
(none); __utmb=31815649.15.9.1305743166630
Pragma: no-cache
Cache-Control: no-cache
addr=445%20West%20Trade%20St.&addr2=doghouse&card_bill_addr=445%20West
%20Trade
%20St.&card_bill_addr2=&card_bill_city=Charlotte&card_bill_state=NC&card
_bill_zip=28202&card_cvc=123&card_expiry=01%2F2013&card_name=Discover&ca
rd_nick=&card_number=6011000990156527&city=Charlotte&delivery_date=3-14&
delivery_time=12%3A19&em=lembark%40wrkhors.com&first_name=do%20not
%20deliver&last_name=test
%20order&phone=8885551212&state=NC&tip=1.00&tray=955705%2F4%2B785624%2F2
%2B4471228%2F4%2B955870%2F5&type=guest&zip=28205
'
'headers_in' => HASH(0x4117cd0)
'Accept' => 'text/html,application/xhtml+xml,application/
xml;q=0.9,*/*;q=0.8'
'Accept-Charset' => 'ISO-8859-1,utf-8;q=0.7,*;q=0.7'
'Accept-Encoding' => 'gzip,deflate'
'Accept-Language' => 'en-us,en;q=0.5'
'Cache-Control' => 'no-cache'
'Content-Length' => 453
'Content-Type' => 'application/x-www-form-urlencoded;
charset=UTF-8'
'Cookie' => '__utmc=31815649;
__utma=31815649.1206902665.1305656423.1305736495.1305742444.5;
__utmz=31815649.1305656423.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=
(none); __utmb=31815649.15.9.1305743166630'
'Host' => 'nn2.deasil.com:7000'
'Keep-Alive' => 115
'Pragma' => 'no-cache'
'Referer' => 'http://nn2.deasil.com:7000/'
'User-Agent' => 'Mozilla/5.0 (X11; U; Linux x86_64; en-US;
rv:1.9.2.16) Gecko/20110423 Gentoo Firefox/3.6.16'
'X-Requested-With' => 'XMLHttpRequest'
'method' => 'POST'
'param' => HASH(0x410da20)
'addr' => '445 West Trade St.'
'addr2' => 'doghouse'
'card_bill_addr' => '445 West Trade St.'
'card_bill_addr2' => ''
'card_bill_city' => 'Charlotte'
'card_bill_state' => 'NC'
'card_bill_zip' => 28202
'card_cvc' => 123
'card_expiry' => '01/2013'
'card_name' => 'Discover'
'card_nick' => ''
'card_number' => 6011000990156527
'city' => 'Charlotte'
'delivery_date' => '3-14'
'delivery_time' => '12:19'
'em' => 'lembark@wrkhors.com'
'first_name' => 'do not deliver'
'last_name' => 'test order'
'phone' => 8885551212
'state' => 'NC'
'tip' => 1.00
'tray' => '955705/4+785624/2+4471228/4+955870/5'
'type' => 'guest'
'zip' => 28205
'uri' => '/o/744'
DB<3> x $request->param( 'card_nick' )
0 HASH(0x410da20)
'addr' => '445 West Trade St.'
'addr2' => 'doghouse'
'card_bill_addr' => '445 West Trade St.'
'card_bill_addr2' => ''
'card_bill_city' => 'Charlotte'
'card_bill_state' => 'NC'
'card_bill_zip' => 28202
'card_cvc' => 123
'card_expiry' => '01/2013'
'card_name' => 'Discover'
'card_nick' => ''
'card_number' => 6011000990156527
'city' => 'Charlotte'
'delivery_date' => '3-14'
'delivery_time' => '12:19'
'em' => 'lembark@wrkhors.com'
'first_name' => 'do not deliver'
'last_name' => 'test order'
'phone' => 8885551212
'state' => 'NC'
'tip' => 1.00
'tray' => '955705/4+785624/2+4471228/4+955870/5'
'type' => 'guest'
'zip' => 28205