|
1 | 1 | diff --git a/kubernetes/client/rest.py b/kubernetes/client/rest.py |
2 | | -index 5716565df..b788bf7d2 100644 |
| 2 | +index 70c57e462..624d26115 100644 |
3 | 3 | --- a/kubernetes/client/rest.py |
4 | 4 | +++ b/kubernetes/client/rest.py |
5 | | -@@ -151,7 +151,12 @@ class RESTClientObject(object): |
6 | | - if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: |
7 | | - if query_params: |
8 | | - url += '?' + urlencode(query_params) |
9 | | -- if re.search('json', headers['Content-Type'], re.IGNORECASE): |
10 | | -+ if (re.search('json', headers['Content-Type'], re.IGNORECASE) or |
11 | | -+ headers['Content-Type'] == 'application/apply-patch+yaml'): |
| 5 | +@@ -159,7 +159,12 @@ class RESTClientObject: |
| 6 | + if ( |
| 7 | + not content_type |
| 8 | + or re.search('json', content_type, re.IGNORECASE) |
| 9 | ++ or content_type == 'application/apply-patch+yaml' |
| 10 | + ): |
12 | 11 | + if headers['Content-Type'] == 'application/json-patch+json': |
13 | 12 | + if not isinstance(body, list): |
14 | | -+ headers['Content-Type'] = \ |
15 | | -+ 'application/strategic-merge-patch+json' |
| 13 | ++ headers['Content-Type'] = 'application/strategic-merge-patch+json' |
| 14 | ++ request_body = None |
16 | 15 | request_body = None |
17 | 16 | if body is not None: |
18 | 17 | request_body = json.dumps(body) |
0 commit comments