bug #38190 [Notifier] Fix errors parsing in FirebaseTransport (jderusse)

This PR was merged into the 5.1 branch.

Discussion
----------

[Notifier] Fix errors parsing in FirebaseTransport

| Q             | A
| ------------- | ---
| Branch?       | 5.1
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | /
| License       | MIT
| Doc PR        | /

I noticed that, when parsing the response, this transport use `getHeader()` like a `string[]` instead of `string[][]`.

I did not test it and I'm not sure about this fix: could you have a look @Jeroeny ?

Commits
-------

2818e2cd43 Fix errors parsing in FirebaseTransport
This commit is contained in:
Nicolas Grekas 2020-09-15 09:17:03 +02:00
commit ae655bf6d4

View File

@ -73,7 +73,7 @@ final class FirebaseTransport extends AbstractTransport
'json' => array_filter($options),
]);
$contentType = $response->getHeaders(false)['Content-Type'] ?? '';
$contentType = $response->getHeaders(false)['content-type'][0] ?? '';
$jsonContents = 0 === strpos($contentType, 'application/json') ? $response->toArray(false) : null;
if (200 !== $response->getStatusCode()) {