(t *testing.T)
| 421 | } |
| 422 | |
| 423 | func TestSetupRequestOptionsParsesHeaders(t *testing.T) { |
| 424 | opts := setupRequestOptions( |
| 425 | "https://example.com/admin", |
| 426 | "", |
| 427 | "", |
| 428 | []string{"X-Test: one:two"}, |
| 429 | "", |
| 430 | "payloads", |
| 431 | "", |
| 432 | false, |
| 433 | []string{"headers"}, |
| 434 | true, |
| 435 | false, |
| 436 | 1000, |
| 437 | false, |
| 438 | false, |
| 439 | ) |
| 440 | |
| 441 | if len(opts.headers) != 2 { |
| 442 | t.Fatalf("expected 2 headers, got %d", len(opts.headers)) |
| 443 | } |
| 444 | |
| 445 | if opts.headers[0].key != "User-Agent" || opts.headers[0].value != "nomore403" { |
| 446 | t.Fatalf("unexpected default User-Agent header: %#v", opts.headers[0]) |
| 447 | } |
| 448 | |
| 449 | if opts.headers[1].key != "X-Test" || opts.headers[1].value != "one:two" { |
| 450 | t.Fatalf("unexpected custom header: %#v", opts.headers[1]) |
| 451 | } |
| 452 | } |
nothing calls this directly
no test coverage detected