Skip to content

Support custom HTTP headers on folio_* requests - #146

Merged
btravisebsco merged 1 commit into
masterfrom
support-custom-headers
Sep 18, 2026
Merged

btravisebsco merged 1 commit into
masterfrom
support-custom-headers

Conversation

@btravisebsco

Copy link
Copy Markdown

Summary

  • Adds a headers kwarg to folio_get, folio_put, folio_post, folio_delete (and their async variants) plus folio_get_all/folio_get_all_async and their pagination helpers, so callers can pass per-request HTTP headers that are merged with the client's default auth headers.- Adds debug logging to list unused kwargs

Test plan

  • Added TestCustomHeaders in tests/test_folio_client.py covering header forwarding for folio_get/folio_put/folio_post/folio_delete and async variants, plus regression tests for _folio_get_all/_folio_get_all_async (the fixed bug) and regression-guard tests for _folio_get_all_by_id_offset/_async.
  • uv run python -m pytest tests/ — 284 passed locally.

Allow callers to pass a headers dict to folio_get/put/post/delete (and
their async and pagination variants) for per-request custom headers,
merged with the client's default auth headers.
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
24.6% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@btravisebsco
btravisebsco merged commit ad30079 into master Sep 18, 2026
6 of 7 checks passed
@btravisebsco
btravisebsco deleted the support-custom-headers branch September 18, 2026 16:25
bltravis added a commit that referenced this pull request Sep 18, 2026
SonarCloud's quality gate failed PR #146 on new-code duplication
(24.6%, threshold 3%), isolated to tests/test_folio_client.py
(32% new-code duplication). Extract shared helpers for the mock
httpx client setup and the paginated folio_get fake, reused across
all 13 tests in TestCustomHeaders.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants