Skip to content

Add connections - #1

Merged
lovelydinosaur merged 4 commits into
masterfrom
add-connections
Apr 6, 2019
Merged

lovelydinosaur merged 4 commits into
masterfrom
add-connections

Conversation

@lovelydinosaur

Copy link
Copy Markdown
Member

No description provided.

@lovelydinosaur
lovelydinosaur merged commit 7626fe7 into master Apr 6, 2019
@lovelydinosaur
lovelydinosaur deleted the add-connections branch April 6, 2019 12:21
blitzy Bot referenced this pull request in blitzy-research/httpx Jul 16, 2026
…RITICAL QA findings)

Two client store-preservation paths flattened a CookieStore into the legacy
Cookies/CookieJar machinery, which cannot ingest a CookieStore and crashed with
"AttributeError: 'str' object has no attribute 'domain'".

Finding #1 (_merge_cookies): per-request cookies=CookieStore on a legacy-Cookies
client crashed (or silently flattened). The merge now targets a CookieStore when
EITHER the client store or the per-request argument is a CookieStore, preserving
its deterministic RFC 6265/6265bis semantics.

Finding #2 (_build_redirect_request): a CookieStore-backed Client/AsyncClient
crashed on any redirect once the store held a cookie. The redirect now preserves
the CookieStore instance instead of wrapping it in Cookies(...), mirroring the
__init__/setter/merge preservation pattern.

Both fixes are confined to httpx/_client.py; the Cookies class, _models.py, and
_cookiestore.py are unchanged (strict additivity / backward compatibility).

Adds regression tests in tests/client/test_cookies.py covering per-request
CookieStore on a legacy client, client+per-request merge, CookieStore-backed
redirect (sync + async), and host-only no-leak across a cross-host redirect.
httpx/_client.py returns to 100% line coverage.
@DhyanMehta

Copy link
Copy Markdown

CodeGuardian Review — PR #1

Status: Completed (3/4 agents succeeded, 1 could not run)
Commit: b5addb6

Summary

  • 1 medium-severity (1 documentation)
  • 5 low-severity (4 security, 1 test gap)
  • Auto-fix available for 1 finding(s)

Incomplete review: Quality did not run, so this report does not cover that area. Counts above are a lower bound.


Findings

🟡 Medium

# Agent File Finding
1 Documentation tests/models/test_responses.py:996 Docstring missing: test_response_decode_text_using_autodetect: Function at tests/models/test_responses.py:996

⚪ Low

# Agent File Finding
2 Security tests/models/test_responses.py:1012 B101: Use of assert statement inside a test file (tests/models/test_responses.py). This is standard practice in Python testing and poses no security risk.
3 Security tests/models/test_responses.py:1013 B101: Use of assert statement inside a test file (tests/models/test_responses.py). This is standard practice in Python testing and poses no security risk.
4 Security tests/models/test_responses.py:1017 B101: Use of assert statement inside a test file (tests/models/test_responses.py). This is standard practice in Python testing and poses no security risk.
5 Security tests/models/test_responses.py:1018 B101: Use of assert statement inside a test file (tests/models/test_responses.py). This is standard practice in Python testing and poses no security risk.
6 Test Gap tests/models/test_responses.py:996 Untested: test_response_decode_text_using_autodetect: Risk score: 2.3/10

Agent Status

Agent Status Findings
Security ✅ (semgrep OK, bandit OK, gitleaks OK) 4
Quality ⚠️ could not run (No coding-standards context retrieved: Collection 'coding_standards' not found. ) —
Test Gap ✅ 1
Documentation ✅ 1

Auto-Fix Available

1 finding(s) have auto-generated fixes (test drafts, docstrings). No code is pushed without your explicit approval.


Generated by CodeGuardian AI

@DhyanMehta

Copy link
Copy Markdown

CodeGuardian Review — PR #1

Status: Completed (4/4 agents succeeded)
Commit: b5addb6

Summary

  • 1 medium-severity (1 documentation)
  • 5 low-severity (4 security, 1 test gap)
  • Auto-fix available for 1 finding(s)

Findings

🟡 Medium

# Agent File Finding
1 Documentation tests/models/test_responses.py:996 Docstring missing: test_response_decode_text_using_autodetect: Function at tests/models/test_responses.py:996

⚪ Low

# Agent File Finding
2 Security tests/models/test_responses.py:1012 B101: Use of 'assert' statement inside a test file (tests/models/test_responses.py). This is standard practice in Python testing frameworks and does not pose a security risk in this context.
3 Security tests/models/test_responses.py:1013 B101: Use of 'assert' statement inside a test file (tests/models/test_responses.py). This is standard practice in Python testing frameworks and does not pose a security risk in this context.
4 Security tests/models/test_responses.py:1017 B101: Use of 'assert' statement inside a test file (tests/models/test_responses.py). This is standard practice in Python testing frameworks and does not pose a security risk in this context.
5 Security tests/models/test_responses.py:1018 B101: Use of 'assert' statement inside a test file (tests/models/test_responses.py). This is standard practice in Python testing frameworks and does not pose a security risk in this context.
6 Test Gap tests/models/test_responses.py:996 Untested: test_response_decode_text_using_autodetect: Risk score: 2.3/10

Agent Status

Agent Status Findings
Security ✅ (semgrep OK, bandit OK, gitleaks OK) 4
Quality ✅ 0
Test Gap ✅ 1
Documentation ✅ 1

Auto-Fix Available

1 finding(s) have auto-generated fixes (test drafts, docstrings). No code is pushed without your explicit approval.


Generated by CodeGuardian AI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants