Merge pull request #205 from bsherman/2.0patch-fix

fix for #187 failure when using RFC 6902 json-patch operation
This commit is contained in:
Mehdy Bohlool 2017-05-01 11:04:59 -07:00 committed by GitHub
commit ccc98096bf
2 changed files with 5 additions and 2 deletions

View File

@ -1,3 +1,6 @@
# v2.0.0b2
- Bugfix: support RFC6902 'json-patch' operations #187
# v1.0.1
- Bugfix: urllib3 1.21 fails tests, Excluding version 1.21 from dependencies #197

View File

@ -154,8 +154,8 @@ class RESTClientObject(object):
if query_params:
url += '?' + urlencode(query_params)
if headers['Content-Type'] == 'application/json-patch+json':
headers[
'Content-Type'] = 'application/strategic-merge-patch+json'
if not isinstance(body, list):
headers['Content-Type'] = 'application/strategic-merge-patch+json'
request_body = None
if body:
request_body = json.dumps(body)