diff options
Diffstat (limited to 'swiftclient/client.py')
-rw-r--r-- | swiftclient/client.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/swiftclient/client.py b/swiftclient/client.py index 80b6eda..80bc4a3 100644 --- a/swiftclient/client.py +++ b/swiftclient/client.py @@ -1286,8 +1286,10 @@ def put_object(url, token=None, container=None, name=None, contents=None, if content_type is not None: headers['Content-Type'] = content_type elif 'Content-Type' not in headers: - # python-requests sets application/x-www-form-urlencoded otherwise - headers['Content-Type'] = '' + if StrictVersion(requests.__version__) < StrictVersion('2.4.0'): + # python-requests sets application/x-www-form-urlencoded otherwise + # if using python3. + headers['Content-Type'] = '' if not contents: headers['Content-Length'] = '0' |