Skip to content

feat(network): custom HTTP handler / fetch interception callback#921

Merged
chaliy merged 1 commit intomainfrom
feat/issue-911-http-handler
Mar 31, 2026
Merged

feat(network): custom HTTP handler / fetch interception callback#921
chaliy merged 1 commit intomainfrom
feat/issue-911-http-handler

Conversation

@chaliy
Copy link
Copy Markdown
Contributor

@chaliy chaliy commented Mar 31, 2026

Summary

  • Add HttpHandler trait for custom HTTP request interception
  • Allowlist check happens before handler is called (security boundary preserved)
  • Builder API: .http_handler(Box::new(MyHandler))
  • Both request_with_headers and request_with_timeouts delegate to handler
  • Re-export HttpHandler and HttpResponse from crate root

Test plan

  • custom_handler_intercepts_requests — mock handler returns custom response via curl
  • custom_handler_allowlist_still_enforced — empty allowlist blocks even with handler set
  • cargo clippy -- -D warnings clean

Closes #911

Add HttpHandler trait that embedders can implement to intercept,
proxy, log, cache, or mock HTTP requests. The allowlist check happens
before the handler is called, preserving the security boundary.
Includes builder API (.http_handler()) and integration tests.

Closes #911
@chaliy chaliy merged commit 9339490 into main Mar 31, 2026
27 checks passed
@chaliy chaliy deleted the feat/issue-911-http-handler branch March 31, 2026 10:52
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.

feat(network): custom HTTP handler / fetch interception callback

1 participant