MCPcopy Create free account
hub / github.com/devploit/nomore403 / TestSetupRequestOptionsParsesHeaders

Function TestSetupRequestOptionsParsesHeaders

cmd/requester_test.go:423–452  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

421}
422
423func 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}

Callers

nothing calls this directly

Calls 1

setupRequestOptionsFunction · 0.85

Tested by

no test coverage detected