-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Labels
Description
Expected behavior
I should be able to set the 'Authorization' header in my Pimcore Elasticsearch client.
Actual behavior
The following configuration throws an error 'Invalid type for path "pimcore_elasticsearch_client.es_clients.default.http_options.headers". Expected "scalar", but got "array".':
pimcore_elasticsearch_client:
es_clients:
default:
hosts: '%elastic.hosts%'
http_options:
headers:
Authorization: 'ApiKey OW5tRm1wa...lYTNTdw=='If I use a scalar, e.g:
pimcore_elasticsearch_client:
es_clients:
default:
hosts: '%elastic.hosts%'
http_options:
headers: 'Authorization: ApiKey OW5tRm1wa...YTNTdw=='then the error is 'Symfony\Component\HttpClient\CurlHttpClient::normalizeHeaders(): Argument #1 ($headers) must be of type array, string given'.
So, the configuration expects each HTTP option to be a scalar, but the HTTP client expects an array for some options, like headers.
Steps to reproduce
Use any of the above configurations and trigger container compilation, e.g. simply run bin/console cache:clear.
autarchprinceps