| 141 | } |
| 142 | |
| 143 | func 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 | |
| 161 | func TestBuild_EmptyWord(t *testing.T) { |
| 162 | headers := make(http.Header) |