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

Function TestBuild_EmptyWord

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

Source from the content-addressed store, hash-verified

159}
160
161func TestBuild_EmptyWord(t *testing.T) {
162 headers := make(http.Header)
163 headers.Set("X-Token", "{{FUZZ}}")
164
165 rc := &RequestConfig{
166 Method: "GET",
167 Headers: headers,
168 }
169 req, err := rc.Build(context.Background(), STANDARD, "http://example.com", "/test", "", "")
170 if err != nil {
171 t.Fatal(err)
172 }
173 got := req.StandardRequest.Header.Get("X-Token")
174 if got != "" {
175 t.Errorf("X-Token with empty word = %q, want empty", got)
176 }
177}

Callers

nothing calls this directly

Calls 1

BuildMethod · 0.95

Tested by

no test coverage detected