MCPcopy Create free account
hub / github.com/chainreactors/spray / TestBuild_FuzzInHost

Function TestBuild_FuzzInHost

core/ihttp/request_fuzz_test.go:25–39  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

23}
24
25func TestBuild_FuzzInHost(t *testing.T) {
26 rc := &RequestConfig{
27 Method: "GET",
28 Headers: make(http.Header),
29 Host: "{{FUZZ}}.internal.com",
30 }
31 req, err := rc.Build(context.Background(), STANDARD, "http://10.0.0.1", "/test", "", "dev")
32 if err != nil {
33 t.Fatal(err)
34 }
35 host := req.Host()
36 if host != "dev.internal.com" {
37 t.Errorf("Host = %q, want dev.internal.com", host)
38 }
39}
40
41func TestBuild_FuzzInHeader(t *testing.T) {
42 headers := make(http.Header)

Callers

nothing calls this directly

Calls 2

BuildMethod · 0.95
HostMethod · 0.80

Tested by

no test coverage detected