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

Function TestBuildCurlParserInvocationUsesMinimalHeaders

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

Source from the content-addressed store, hash-verified

169}
170
171func TestBuildCurlParserInvocationUsesMinimalHeaders(t *testing.T) {
172 args, display := buildCurlParserInvocation("GET", "https://example.com/admin", "", false)
173 joined := strings.Join(args, " ")
174 for _, headerName := range []string{"User-Agent:", "Accept:", "Connection:", "Host:"} {
175 if !strings.Contains(joined, headerName) {
176 t.Fatalf("expected stripped parser header %q in args: %v", headerName, args)
177 }
178 }
179 if !strings.Contains(display, "'User-Agent:'") {
180 t.Fatalf("expected parser display command to show stripped headers, got %q", display)
181 }
182}
183
184func TestBuildAbsoluteURIPayloadsAvoidsMalformedDoubleSlash(t *testing.T) {
185 parsed, err := url.Parse("https://example.com/web.config")

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected