summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--swiftclient/service.py2
-rw-r--r--tests/unit/test_service.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/swiftclient/service.py b/swiftclient/service.py
index 6ccba55..3820ace 100644
--- a/swiftclient/service.py
+++ b/swiftclient/service.py
@@ -280,7 +280,7 @@ def split_headers(options, prefix=''):
for item in options:
split_item = item.split(':', 1)
if len(split_item) == 2:
- headers[(prefix + split_item[0]).title()] = split_item[1]
+ headers[(prefix + split_item[0]).title()] = split_item[1].strip()
else:
raise SwiftError(
"Metadata parameter %s must contain a ':'.\n%s"
diff --git a/tests/unit/test_service.py b/tests/unit/test_service.py
index 2e7acf9..989699f 100644
--- a/tests/unit/test_service.py
+++ b/tests/unit/test_service.py
@@ -496,7 +496,7 @@ class TestServiceUtils(unittest.TestCase):
self.assertEqual(opt_c['key'], 'key')
def test_split_headers(self):
- mock_headers = ['color:blue', 'size:large']
+ mock_headers = ['color:blue', 'SIZE: large']
expected = {'Color': 'blue', 'Size': 'large'}
actual = swiftclient.service.split_headers(mock_headers)