Convert md5 and other checksums to lowercase when setting a location

Bug #1658882 reported by Mike Fedosin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glare
Confirmed
Low
Unassigned

Bug Description

Now when user wants to set a location to a blob he has to specify at least md5 checksum. In common case the standard doesn't differentiate in what case this string is written. In other words strings '9d385dfdba883dfb789777e77f19310c' are '9D385DFDBA883DFB789777E77F19310C' equal.

Unfortunately for Glare the case the case matters and if it tries to compare to strings from example - it fails. For this reason we need to convert these checksum string to lower case before putting them in store. 'strip' also will be good.

https://github.com/openstack/glare/blob/e25d6605ff381908aadd36436a5005ec96b652fb/glare/engine.py#L272

Instead of 'md5 = blob_meta.pop("md5", None)' there should be

"
try:
    md5 = blob_meta.pop("md5").strip().lower()
except KeyError:
...
"

Revision history for this message
Mike Fedosin (mfedosin) wrote :

Other checksum strings (sha1, sha256) should also be converted if they exist in the request body!

Changed in glare:
status: New → Confirmed
Mike Fedosin (mfedosin)
Changed in glare:
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.