Bug #44185
XML body always need a root node
Status: | New | Start date: | 2012-12-21 | |
---|---|---|---|---|
Priority: | Should have | Due date: | ||
Assigned To: | - | % Done: | 0% |
|
Category: | MVC | |||
Target version: | TYPO3 Flow Base Distribution - 2.0.1 | |||
PHP Version: | Complexity: | |||
Has patch: | No | Affected Flow version: | Git master |
Description
If the request contains xml and the Content-Type header is set to "*/xml" the client currently has to surround the XML with an additional root node (which is basically ignored):
curl -i -H "Accept: application/xml" -H "Content-Type: application/xml" -X POST -d "<anything><product><title>foo</title></product></anything>" http://localhost/products
Instead the root node should be omitted:
curl -i -H "Accept: application/xml" -H "Content-Type: application/xml" -X POST -d "<product><title>foo</title></product>" http://localhost/products
This could be achieved by replacing
1$xmlElement = new \SimpleXMLElement(urldecode($body), LIBXML_NOERROR);
with
1$xmlElement = new \SimpleXMLElement('<root>' . urldecode($body) . '</root>', LIBXML_NOERROR);
in Http\Request::decodeBodyArguments().
History
#1 Updated by Karsten Dambekalns almost 2 years ago
- Target version changed from 2.0 to 2.0.1