atlassian-python-api icon indicating copy to clipboard operation
atlassian-python-api copied to clipboard

Insight (Assets) class not correctly setting self.default_headers when cloud=True

Open aculver opened this issue 1 year ago • 1 comments

from atlassian import Insight
import config

with open(config.api_token_file, 'r') as token_file:
    api_user, api_pass = token_file.read().strip().split(':')

insight = Insight(
    url=config.site_url,
    username=api_user,
    password=api_pass,
    cloud=True)
print(insight.default_headers)

Outputs: {'Accept': 'application/json'}

Should be: {'Accept': 'application/json', 'Content-Type': 'application/json'}

aculver avatar May 28 '24 21:05 aculver

hm, interesting as based on the base method all good https://github.com/atlassian-api/atlassian-python-api/blob/master/atlassian/rest_client.py#L23

gonchik avatar May 29 '24 10:05 gonchik

        self.default_headers = {"Accept": "application/json", "Content-Type": "application/json"}
        return args, kwargs```

gonchik avatar Mar 30 '25 19:03 gonchik