If you try to fetch an HTTP URL that includes credentials, and if you
get redirected, even to the same server, then LFTP drops the
credentials, resulting in an access denied. Here's an example of debug
output, with the personal info changed:
lftp command typed was: get1
http://username:mypassw...@www.example.com/mypath
Debug output. Note that all the redirect is doing is add a trailing
slash; surely lftp should not drop the credentials just for that:
---- Resolving host address...
---- 1 address found: 10.11.12.13
---- Connecting to www.example.com (10.11.12.13) port 80
---- Sending request...
---> GET /mypath HTTP/1.1
---> Host: www.example.com
---> User-Agent: lftp/3.7.11
---> Accept: */*
---> Authorization: Basic XNlcm5hbWU6bXlwYXNzd29yZA==
---> Connection: keep-alive
--->
<--- HTTP/1.1 301 Moved Permanently
<--- Location: http://www.example.com/mypath/
<--- Content-Length: 0
<--- Date: Fri, 14 Sep 2012 17:52:38 GMT
<--- Server: lighttpd
<---
copy: received redirection to `http://www.example.com/mypath/'
---- Connecting to www.example.com (10.11.12.13) port 80
---- Sending request...
---> GET /mypath/ HTTP/1.1
---> Host: www.example.com
---> User-Agent: lftp/3.7.11
---> Accept: */*
---> Connection: keep-alive
--->
<--- HTTP/1.1 401 Unauthorized
<--- WWW-Authenticate: Basic realm="My Example"
<--- Content-Type: text/html
<--- Content-Length: 351
<--- Date: Fri, 14 Sep 2012 17:52:38 GMT
<--- Server: lighttpd
<---
<--*
<--* 401 - Unauthorized
<--*
<--*
<--* 401 - Unauthorized
<--*
cat: Access failed: 401 Unauthorized (/mypath/)
---- Closing HTTP connection
---- Closing HTTP connection
wget and curl seem to have configurable options for this.
David
--
WordShell - WordPress fast from the CLI - www.wordshell.net
_______________________________________________
lftp-devel mailing list
lftp-devel@uniyar.ac.ru
http://univ.uniyar.ac.ru/mailman/listinfo/lftp-devel