| 39 | } |
| 40 | |
| 41 | func TestBuild_FuzzInHeader(t *testing.T) { |
| 42 | headers := make(http.Header) |
| 43 | headers.Set("Authorization", "Bearer {{FUZZ}}") |
| 44 | headers.Set("X-Normal", "static-value") |
| 45 | |
| 46 | rc := &RequestConfig{ |
| 47 | Method: "GET", |
| 48 | Headers: headers, |
| 49 | } |
| 50 | req, err := rc.Build(context.Background(), STANDARD, "http://example.com", "/test", "", "token123") |
| 51 | if err != nil { |
| 52 | t.Fatal(err) |
| 53 | } |
| 54 | authVal := req.StandardRequest.Header.Get("Authorization") |
| 55 | if authVal != "Bearer token123" { |
| 56 | t.Errorf("Authorization = %q, want 'Bearer token123'", authVal) |
| 57 | } |
| 58 | normalVal := req.StandardRequest.Header.Get("X-Normal") |
| 59 | if normalVal != "static-value" { |
| 60 | t.Errorf("X-Normal = %q, want 'static-value'", normalVal) |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | func TestBuild_FuzzInBody(t *testing.T) { |
| 65 | rc := &RequestConfig{ |