newFetchToolForTest constructs a FetchTool that bypasses SSRF dial-time protection so tests can talk to httptest.NewServer (which binds to 127.0.0.1). It is defined in a *_test.go file so it is not compiled into release binaries. Production callers must use [New], which refuses non-public addresses
(opts ...ToolOption)
| 31 | // caller options still take precedence (a later option overrides an |
| 32 | // earlier one). |
| 33 | func newFetchToolForTest(opts ...ToolOption) *ToolSet { |
| 34 | return New(append([]ToolOption{WithAllowPrivateIPs(true), WithExpander(js.NewJsExpander(&testEnvProvider{}))}, opts...)...) |
| 35 | } |
| 36 | |
| 37 | func TestFetchToolWithOptions(t *testing.T) { |
| 38 | t.Parallel() |
no test coverage detected