curl
curl copied to clipboard
Argument -L doesn't work
Describe the bug Argument -L doesn't work
Environment Windows Reverse proxy ? N VPN ? N Proxy ? Y , but behavior is exactly same when proxy is disabled
Curl command line curl -L http://<myIP>/page/
Expected behavior Should work like curl.exe curl.exe gives me the same error when there is no --location argument provided!!
Stacktrace HttpResponseProxy{HTTP/1.0 308 PERMANENT REDIRECT [Content-Type: text/html; charset=utf-8, Content-Length: 281, Location: http://<myIP>/page/, Server: Werkzeug/0.15.2 Python/2.7.13, Date: Tue, 09 Apr 2019 04:46:14 GMT] ResponseEntityProxy{[Content-Type: text/html; charset=utf-8,Content-Length: 281,Chunked: false]}}
Hi, will try tomorrow, thanks for the feedback.
Try this :
@Test
public void curlWithRedirect () {
curl("-L http://www.yahoo.com");
}
add a breakpoint in org.apache.http.impl.execchain.RedirectExec.execute
(RedirectExec.java:116)
I am simulating the hsts feature (automatic redirect to https). And it just works
So maybe your problem relates to something else. Do you have a public url that is not too confidential that I can test to reproduce the error ?
Sorry, this is closed corporate environment.
I believe you should set a log4j.properties file next to your code, with this content :
log4j.logger.org.apache.http=DEBUG
re run your code, and then give me the logs. thanks
Also do you know if you have a value set for one of these variables :
$HTTP_PROXY
or $HTTPS_PROXY
?