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

Function TestBuild_FastHTTP_FuzzInHeader

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

Source from the content-addressed store, hash-verified

141}
142
143func TestBuild_FastHTTP_FuzzInHeader(t *testing.T) {
144 headers := make(http.Header)
145 headers.Set("X-Key", "{{FUZZ}}")
146
147 rc := &RequestConfig{
148 Method: "GET",
149 Headers: headers,
150 }
151 req, err := rc.Build(context.Background(), FAST, "http://example.com", "/test", "", "val123")
152 if err != nil {
153 t.Fatal(err)
154 }
155 got := string(req.FastRequest.Header.Peek("X-Key"))
156 if got != "val123" {
157 t.Errorf("X-Key = %q, want val123", got)
158 }
159}
160
161func TestBuild_EmptyWord(t *testing.T) {
162 headers := make(http.Header)

Callers

nothing calls this directly

Calls 1

BuildMethod · 0.95

Tested by

no test coverage detected