Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.0.3
-
Fix Version/s: 1.5.3
-
Component/s: Zend_Rest_Server
-
Labels:None
-
Fix Version Priority:Must Have
Description
If i call a Rest-Service this way:
/foo?method=test&arg0=xxxx&arg1=yyyy
everything works as expected.
But If I change the order of the arguments like this:
/foo?method=test&arg1=yyyy&arg0=xxxx
yyyy is used as first and xxxx as second argument.
I actually found the problem when using Zend_Rest_Client to access the Rest-Server - and Http_Client sometimes disorders the arguments in the request.
This little patch solves the problem:
Index: Zend/Rest/Server.php
===================================================================
--- Zend/Rest/Server.php (revision 6541)
+++ Zend/Rest/Server.php (working copy)
@@ -144,6 +144,7 @@
$calling_args[$key]= $value;
}
}
+ ksort($calling_args);
if (count($calling_args) < count($func_args)) {
throw new Zend_Rest_Server_Exception('Invalid Method Call to ' . $this->_method . '. Requires ' . count($func_args) . ', ' . count($calling_args) . ' given.', 400);
thanks,
niko
Scheduling for next mini release.