php-opencloud / openstack

PHP SDK for OpenStack clouds
Apache License 2.0
222 stars 152 forks source link

HTTP header names are case-insensitive #406

Closed drzraf closed 3 months ago

drzraf commented 3 months ago

I guess a Guzzle update or the swift provider HTTP server or a Swift update (or an intermediary proxy) changed the case of the HTTP headers and... getMetadata() started being empty what drove me crazy until I understood it.

drzraf commented 3 months ago

need a unit test for this case

I'm sorry, I can't enter into such a thing.

k0ka commented 3 months ago

I merged case insensitive comparison. But filling the metadata must be the same for backward compatibility. I can release "uniform" metadata in the next major release, but I'm not planning it in the near future.

You might create an interface to check metadata case-insensitive. Like $object->hasMetadataKey($key), $object->getMetadataKey($key) instead of manually checking keys of $object->getMetadata() array. But this will also require tests.