Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Storage Object Metadata keys not returned in lowercase #584

Open
mwidman opened this issue Nov 6, 2015 · 0 comments
Open

Storage Object Metadata keys not returned in lowercase #584

mwidman opened this issue Nov 6, 2015 · 0 comments

Comments

@mwidman
Copy link

mwidman commented Nov 6, 2015

Contrary to the documentation, in 1.9.5, the metadata keys are not returned in lowercase.

In 1.9.3 a metadata submitted as "last_timestamp" or "X-Object-Meta-last-timestamp" would be returned as "last_timestamp"; however, in 1.9.5 it is now returned as "X_Object_Meta_Last_Timestamp". Note the inclusion of the prefix AND the conversion to initial uppercase after each '_'.

I don't mind the inclusion of the prefix as that is how it worked prior to 1.9.3 (see this comment regarding that: #549 (comment)); however, sending key back not in lowercase is contrary to the docs as previously stated.

I have tracked it down to a bug in the code on line 2118 in object_storage.py where the key "hkey" is converted to lowercase "lowkey" but that converted key is not used:

        for hkey, hval in list(resp.headers.items()):
            lowkey = hkey.lower()  # Converted but not used as the return value
            if lowkey.startswith(low_prefix):
                cleaned = hkey.replace(low_prefix, "").replace("-", "_")
                ret[cleaned] = hval
        return ret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant