Skip to content

Include upstream request headers in Foundry fork command and add unit test#134

Open
fubuloubu wants to merge 1 commit intomainfrom
codex/fix-header-forwarding-in-plugin
Open

Include upstream request headers in Foundry fork command and add unit test#134
fubuloubu wants to merge 1 commit intomainfrom
codex/fix-header-forwarding-in-plugin

Conversation

@fubuloubu
Copy link
Copy Markdown
Member

Motivation

  • Ensure that when forking an upstream network, any required HTTP request headers (like auth or tracing headers) are forwarded to the forked node so upstream requests include the same context.

Description

  • Retrieve upstream headers via network_manager.get_request_headers using forked_network.ecosystem.name, forked_network.upstream_network.name, and upstream_provider_name inside FoundryForkProvider.build_command.
  • Append each returned header to the foundry/anvil command as --fork-header "key: value" so they are passed when starting the fork.
  • Add an import for PropertyMock and a new unit test test_fork_build_command_adds_upstream_request_headers in tests/test_provider.py that verifies get_request_headers is called and --fork-header entries are included in the built command.

Testing

  • Ran the new unit test pytest tests/test_provider.py::test_fork_build_command_adds_upstream_request_headers and it passed.
  • Ran the provider test file pytest tests/test_provider.py to ensure no regressions in provider behavior and all tests passed.

Codex Task

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant