swift/test
Romain LE DISEZ 091157fc7f Fix encoding issue in ssync_sender.send_put()
EC object metadata can currently have a mixture of bytestrings and
unicode.  The ssync_sender.send_put() method raises an
UnicodeDecodeError when it attempts to concatenate the metadata
values, if any bytestring has non-ascii characters.

The root cause of this issue is that the object server uses unicode
for the keys of some object metadata items that are received in the
footer of an EC PUT request, whereas all other object metadata keys
and values are persisted as bytestrings.

This patch fixes the bug by changing diskfile write_metadata()
function to encode all unicode metadata keys and values as utf8
encoded bytes before writing to disk. To cope with existing objects
that have a mixture of unicode and bytestring metadata, the diskfile
read_metadata() function is also changed so that all returned unicode
metadata keys and values are utf8 encoded. This ensures that
ssync_sender.send_put() (and any other caller of diskfile
read_metadata) only reads bytestrings from object metadata.

Closes-Bug: #1678018
Co-Authored-By: Alistair Coles <alistairncoles@gmail.com>
Change-Id: Ic23c55754ee142f6f5388dcda592a3afc9845c39
2017-04-19 18:05:52 +01:00
..
functional Factor out a bunch of common testing setup 2017-03-23 00:27:39 +00:00
probe Fix encoding issue in ssync_sender.send_put() 2017-04-19 18:05:52 +01:00
unit Fix encoding issue in ssync_sender.send_put() 2017-04-19 18:05:52 +01:00
__init__.py Raise ValueError if a config section does not exist 2016-12-15 19:49:57 +00:00
sample.conf [Trivial]Fix some type errors in ../sample.conf 2017-02-12 01:30:34 -08:00