xero-python icon indicating copy to clipboard operation
xero-python copied to clipboard

DeprecationWarning in api_client and rest: `getheader` and `getheaders`

Open sshishov opened this issue 6 months ago • 4 comments

Hi dear Xero team,

We are receiving the following warning from your codebase:

DeprecationWarning: HTTPResponse.getheaders() is deprecated and will be removed in urllib3 v2.6.0.
Instead access HTTPResponse.headers directly.

I have noticed the usage in files:

  • rest.py:48: return self.urllib3_response.getheaders()
  • rest.py:52: return self.urllib3_response.getheader(name, default)
  • api_client/__init__.py:221: return (return_data, response_data.status, response_data.getheaders())
  • api_client/__init__.py:604: content_disposition = response.getheader("Content-Disposition")
  • exceptions/__init__.py:38: return self.http_resp.getheaders() if self.http_resp else None

For being able to upgrade urllib3 it is very important to keep the codebase up-to-date. Could you please fix the issue.

Best regards, Sergei

sshishov avatar Jun 27 '25 12:06 sshishov

PETOSS-791

github-actions[bot] avatar Jun 27 '25 12:06 github-actions[bot]

Thanks for raising an issue, a ticket has been created to track your request

github-actions[bot] avatar Jun 27 '25 12:06 github-actions[bot]

How to see the progress? Any updates here?

sshishov avatar Jul 19 '25 16:07 sshishov

urllib3 v2.5.0 has vulnerability that's fixed upgrading to 2.6.0

Unfortunately, this breaks xero-python functionality because of using methods in question.

ton77v avatar Dec 08 '25 07:12 ton77v

any progress? this breaks xero-python functionality and blocks to a urllib3 version with vulnerabilities

golankopi avatar Dec 28 '25 09:12 golankopi