atlassian-api / atlassian-python-api

Atlassian Python REST API wrapper
https://atlassian-python-api.readthedocs.io
Apache License 2.0
1.29k stars 642 forks source link

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

Open aculver opened 1 month ago

aculver commented 1 month ago
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'}

gonchik commented 1 month ago

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