Skip to content

[Bug]: Incompatible with urllib3 2.x - AttributeError: 'HTTPResponse' object has no attribute 'getheader' #58

Description

@khaapamyaki

What happened?

The latest version of the API library (2.2.1) throws an exception when creating a notification with urllib3 2.x installed.

Error:
AttributeError: 'HTTPResponse' object has no attribute 'getheader'

The issue is in onesignal/rest.py line 43, where RESTResponse.getheader() calls self.urllib3_response.getheader(). This method was removed in urllib3 2.0 (April 2023).

The package declares urllib3>=1.25.3 with no upper bound, but the code is not compatible with urllib3 2.x.

Steps to reproduce?

1. Install onesignal-python-api==2.2.1 with urllib3>=2.0 (e.g., urllib3==2.5.0)
2. Create and send a notification using the API
3. Observe AttributeError: 'HTTPResponse' object has no attribute 'getheader'

What did you expect to happen?

The notification should be sent successfully. Either:

  1. The SDK should be updated to use the urllib3 2.x API (.headers.get() instead of .getheader())
  2. Or the package should pin urllib3>=1.25.3,<2 until fixed

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. plisker commented on Dec 16, 2025

    @plisker

    +1 to this issue. Caused an unexpected outage recently in a project I'm working on.

    Also, want to express a strong preference between the two remediation options that the SDK is updated to use urllib3 2.6.0 or higher given recent CVEs CVE-2025-66471 and CVE-2025-66418.

  2. kolbydanner95 commented on Jan 8, 2026

    @kolbydanner95

    +1 any update on this?

  3. sherwinski commented on Jul 28, 2026

    @sherwinski
    Contributor

    Hey everyone, thanks for your patience on this as we work on a fix.
    We currently have an update staged here #110. I'll follow up once a new version has been published.

  4. added a commit that references this issue on Jul 29, 2026
    90fed1a
  5. github-actions commented on Jul 29, 2026

    @github-actions

    🎉 This issue has been resolved in version 5.11.1 🎉

    The release is available on GitHub release

    Your semantic-release bot 📦🚀

  6. self-assigned this
    on Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions