rackspace / php-opencloud

The PHP SDK for OpenStack clouds
developer.rackspace.com
Other
451 stars 250 forks source link

ObjectStore: metadata not found due to case-sensitive comparison #749

Open paulvink opened 4 years ago

paulvink commented 4 years ago

Some hosts convert object metadata keys (and even the entire corresponding HTTP header) to all-lowercase. This is irritating, but since both HTTP headers and Object Store metadata keys are case insensitive, it is not illegal.

MetadataTrait.php uses strpos to test if a header starts with METADATA_PREFIX (e.g. 'X-Object-Meta-') and therefore fails if the capitalization isn't exactly the same, making it seem that the metadata item isn't present.

Using stripos instead of strpos fixes this.