Fixed #EZP-20283: charset in REST request Content-Type headers causes a fatal error

*PROBABLY NOT FOR MERGE*

Crude patch, but gives the idea and the location.