python-tackerclient drop content-type when using HTTPClient

Bug #2052768 reported by Ayumu Ueha
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tacker
New
Undecided
Unassigned

Bug Description

If the `_cs_request()` method called by `do_request()` of HTTPClient class (in python-tackerclient code) [1] contains `content-type` in `kwargs`, an error occurs if `content-type` is not `application/json` because `content-type` has not copied to the kargs passed to request.

[1] https://opendev.org/openstack/python-tackerclient/src/branch/stable/2023.2/tackerclient/client.py#L83-L98

```
    L83~

    def _cs_request(self, *args, **kwargs):
        kargs = {}
        kargs.setdefault('headers', kwargs.get('headers', {}))
        kargs['headers']['User-Agent'] = self.USER_AGENT

        if 'body' in kwargs:
            kargs['body'] = kwargs['body']

        *** Not dealing with `content-type` in kwargs ***

        if self.log_credentials:
            log_kargs = kargs
        else:
            log_kargs = self._strip_credentials(kargs)

        utils.http_log_req(_logger, args, log_kargs)
        try:
            resp, body = self.request(*args, **kargs)
        ...(omit)...
```

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.