alfresco-audit-share
alfresco-audit-share copied to clipboard
Request body malformed
Hello,
We found an issue with some request body (payload) while using AuditShare. The payload catched by AuditShare contains gibberish characters when it's send to alfresco server.
As an example, when updating a folder's metadata (action audited with AuditShare) which contains cyrillic characters, the description was modified as such for the Test folder :
In this case, the form update's request body use correct encoding from Browser to Share server where as from Share to Alfresco back the request body is malformed and contains ???????????.
As we use US-ASCII encoding on alfresco server while the request body is UTF-8 encoded, this issue seems to be coming from an altered request body with wrong encoding. US-ASCII does not support the word ะฟัะธะผะตัั so it's converted to ???????????.
This issue seems to come from the RequestWrapper class which use JVM encoding setting (Default Charset) of alfresco hosting server instead of using request body encoding at these lines :
StringWriter writer = new StringWriter(); IOUtils.copy(inputStream, writer); return writer.toString();
final ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(stringRequest.getBytes());
Affected versions :
- Alfresco Enterprise 5.2.3
- AuditShare 1.5.8
Regards.