Pull in code from requests-unixsocket and support urllib3 v2 #29
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Historically, we've relied on requests-unixsocket to provide connectivity to the private server port, as discussed in
DEVELOPER.md
.We need to be on requests >= v2.31.0 due to CVE-2023-32681. However, requests v2.30.0 started depending on urllib3 v2, which requests-unixsocket is not compatible with. The initial workaround was to pin
urllib3<2
inpyproject.toml
, but that's not a good long-term solution.The problem with requests-unixsocket is tracked in issue #70 and fixed in PR #69, both from May 5. However, as of this writing, the requests-unixsocket maintainer hasn't responded to either the issue or the PR. Given how small the code is, it seems safer and simpler to just pull it in rather than waiting for a new package to be released on PyPI. The code is under Apache v2, so this is permitted use.
This PR pulls source code taken from v0.3.0 on PyPI, because there is no v0.3.0 tag on GitHub.