Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
--max-redirs -1 leads to error "bad argument" #2038
I did this
curl --max-redirs -1 http://dummy.restapiexample.com/api/v1/employees
I expected the following
Get a JSON with HTTP status 200
instead got the following
Did a little research and found commit f121575 to be a candidate for cause.
case CURLOPT_MAXREDIRS: /* * The maximum amount of hops you allow curl to follow Location: * headers. This should mostly be used to detect never-ending loops. */ arg = va_arg(param, long); if(arg < 0) return CURLE_BAD_FUNCTION_ARGUMENT; data->set.maxredirs = arg; break;