| 2506 | } |
| 2507 | |
| 2508 | func buildCurlVersionInvocation(method, uri string, headers []header, proxy string, httpVersion string, followRedirects bool) ([]string, string) { |
| 2509 | args := []string{"-i", "-s", httpVersion} |
| 2510 | displayArgs := []string{"curl", "-i", "-s", httpVersion} |
| 2511 | if method != "" && method != "GET" { |
| 2512 | args = append(args, "-X", method) |
| 2513 | displayArgs = append(displayArgs, "-X", shellQuote(method)) |
| 2514 | } |
| 2515 | for _, h := range headers { |
| 2516 | args = append(args, "-H", h.key+": "+h.value) |
| 2517 | displayArgs = append(displayArgs, "-H", shellQuote(h.key+": "+h.value)) |
| 2518 | } |
| 2519 | if proxy != "" { |
| 2520 | args = append(args, "-x", proxy) |
| 2521 | displayArgs = append(displayArgs, "-x", shellQuote(proxy)) |
| 2522 | } |
| 2523 | if followRedirects { |
| 2524 | args = append(args, "-L") |
| 2525 | displayArgs = append(displayArgs, "-L") |
| 2526 | } |
| 2527 | args = append(args, "--insecure") |
| 2528 | displayArgs = append(displayArgs, "--insecure") |
| 2529 | args = append(args, uri) |
| 2530 | displayArgs = append(displayArgs, shellQuote(uri)) |
| 2531 | return args, strings.Join(displayArgs, " ") |
| 2532 | } |
| 2533 | |
| 2534 | func buildCurlParserInvocation(method, uri string, proxy string, followRedirects bool) ([]string, string) { |
| 2535 | args := []string{"-i", "-s", "--http1.1"} |