[opensuse-buildservice] regression in API request handling by commit 6fd139a1dbc2dfff9cbce7f6555c4c63e11f6a65
Hi Adrian and all,
I found a regression in OBS code that was introduced with commit:
commit 6fd139a1dbc2dfff9cbce7f6555c4c63e11f6a65
Author: Adrian Schröter
On 24.05.2012 17:15, Robert Schiele wrote:
Anyone with an explanation what goes wrong here or even a fix? I am personally quite confused since I don't even understand at the moment what exactly this change is trying to achieve. Was that checking probably applied to the wrong content in this XML file?
Hi, This shows clearly what goes wrong: Started POST "/request?cmd=create" for 127.0.0.1 at 2012-05-24 17:31:50 +0200 [INFO |#10954] Processing by RequestController#create as XML [INFO |#10954] Parameters: {"<request><description>"=>nil, "T"=>[{"</description></request>"=>nil}], "cmd"=>"create"} Your -f test.xml data is transferred as FORM data and as such it's split at [] This happens in rails - Adrian's funtion is then validating that paramters are pure strings and they are not - but in this case there shouldn't be any parameters beside cmd=create Greetings, Stephan -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
On Thu, May 24, 2012 at 5:38 PM, Stephan Kulow
Your -f test.xml data is transferred as FORM data and as such it's split at [] This happens in rails - Adrian's funtion is then validating that paramters are pure strings and they are not - but in this case there shouldn't be any parameters beside cmd=create
Argh! When I was debugging this issue yesterday I completely missed that osc encodes the data in a different way when sending with "osc api -X POST /request?cmd=create -f test.xml" compared to "osc api -X POST /request?cmd=create -d 'some string'". Now after overwriting the standard encoding in osc with "-a Content-Type application/octet-stream" everything is perfectly fine. Thus a lot of thanks for waking up my brain! ;) Robert -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
participants (2)
-
Robert Schiele
-
Stephan Kulow