diff options
author | Chmouel Boudjnah <chmouel@enovance.com> | 2013-11-29 22:59:27 +0100 |
---|---|---|
committer | Chmouel Boudjnah <chmouel@enovance.com> | 2013-12-06 13:28:01 +0100 |
commit | 983988093f3848671cb27b3c1956e4ca62087dff (patch) | |
tree | bd77fb1360d85c554ee3aa3176d48039601d6b6a /swiftclient/client.py | |
parent | 0ef054585a93f80ba4bc72f953f832372e65db60 (diff) | |
download | python-swiftclient-983988093f3848671cb27b3c1956e4ca62087dff.tar.gz |
Don't crash when header is value of None
Before commit 7d88d14d (http://git.io/hhJWdQ) swifclient used to accept
header value with the type None :
{'Headers': None}
It would just be happy with it with those None headers and not process
them, reinstate the old behavior.
Closes-Bug: 1256441
Change-Id: Ic7f80c38ef2ce9ef1687ed0d6d65521f2e754905
Diffstat (limited to 'swiftclient/client.py')
-rw-r--r-- | swiftclient/client.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/swiftclient/client.py b/swiftclient/client.py index 8dc4b71..d7349f3 100644 --- a/swiftclient/client.py +++ b/swiftclient/client.py @@ -97,7 +97,9 @@ def quote(value, safe='/'): def validate_headers(headers): if headers: - for key, value in headers.iteritems(): + for key, raw_value in headers.iteritems(): + value = str(encode_utf8(raw_value)) + if '\n' in value: raise InvalidHeadersException("%r header contained a " "newline" % key) |