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

Function TestBuild_FuzzInQuery

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

Source from the content-addressed store, hash-verified

81}
82
83func TestBuild_FuzzInQuery(t *testing.T) {
84 rc := &RequestConfig{
85 Method: "GET",
86 Headers: make(http.Header),
87 RawQuery: "key={{FUZZ}}&other=static",
88 }
89 req, err := rc.Build(context.Background(), STANDARD, "http://example.com", "/search", "", "test")
90 if err != nil {
91 t.Fatal(err)
92 }
93 uri := req.URI()
94 if uri != "http://example.com/search?key=test&other=static" {
95 t.Errorf("URI = %q, want http://example.com/search?key=test&other=static", uri)
96 }
97}
98
99func TestBuild_NoFuzz(t *testing.T) {
100 rc := &RequestConfig{

Callers

nothing calls this directly

Calls 2

BuildMethod · 0.95
URIMethod · 0.80

Tested by

no test coverage detected