(t *testing.T)
| 169 | } |
| 170 | |
| 171 | func 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 | |
| 184 | func TestBuildAbsoluteURIPayloadsAvoidsMalformedDoubleSlash(t *testing.T) { |
| 185 | parsed, err := url.Parse("https://example.com/web.config") |
nothing calls this directly
no test coverage detected