curl icon indicating copy to clipboard operation
curl copied to clipboard

Argument -L doesn't work

Open andrewg78 opened this issue 5 years ago • 6 comments

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]}}

andrewg78 avatar Apr 10 '19 14:04 andrewg78

Hi, will try tomorrow, thanks for the feedback.

libetl avatar Apr 10 '19 21:04 libetl

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

libetl avatar Apr 11 '19 09:04 libetl

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 ?

libetl avatar Apr 11 '19 09:04 libetl

Sorry, this is closed corporate environment.

andrewg78 avatar Apr 12 '19 09:04 andrewg78

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

libetl avatar Apr 12 '19 15:04 libetl

Also do you know if you have a value set for one of these variables : $HTTP_PROXY or $HTTPS_PROXY ?

libetl avatar Apr 15 '19 06:04 libetl