[php-symfony] Fix problem with clients, that put charset in content type header. (#6078)

* Fix problem with clients, that put charset in content type header.

With this fix header "Content-Type: application/json; charset=utf-8" working same as "Content-Type: application/json" for parse input data

* Fix code style, add $consumes length check.

* Add isContentTypeAllowed static method and tests

* Fix old tests

Right now serializer doesn't support anything beside json and xml.
Call tests with application/json instead of form data.

Co-authored-by: Yuriy Belenko <yura-bely@mail.ru>
This commit is contained in:
Artem
2020-04-30 11:22:44 +02:00
committed by GitHub
parent 8e4452e383
commit 3e2c933dec
15 changed files with 344 additions and 24 deletions

View File

@@ -9,12 +9,14 @@
<testsuite>
<directory>./Tests/Api</directory>
<directory>./Tests/Model</directory>
<directory>./Tests/Controller</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">././Api</directory>
<directory suffix=".php">././Model</directory>
<directory suffix=".php">././Controller</directory>
</whitelist>
</filter>
<php>