From: "Jérémy Lecour" Date: 2010-09-18T04:02:50+09:00 Subject: [ruby-core:32465] [Ruby-Feature#3848][Open] Using http basic authentication for FTP with Open URI --mimepart_4c93bb3e6cb52_eedd1ebb78104e2 Content-Type: text/plain Content-Transfer-Encoding: Quoted-printable Content-Disposition: inline Feature #3848: Using http basic authentication for FTP with Open URI http://redmine.ruby-lang.org/issues/show/3848 Author: J=C3=A9r=C3=A9my Lecour Status: Open, Priority: Normal Assigned to: Akira Tanaka, Category: lib Hi, I needed to download a file from a FTP server, with OpenURI and I've foun= d that it is not possible to do it with authentication. There is an option in the OpenURI open method to use a username/password = but it is not used in FTP connection, the username/password for FTP is al= ways set to anonymous/_nil_. I've written avery basic patch to use the option. Is it something that can be included in future releases of Ruby ? Is ther= e a "clean" way to patch OpenURI in the meantime ? Thanks. ---------------------------------------- http://redmine.ruby-lang.org --mimepart_4c93bb3e6cb52_eedd1ebb78104e2 Content-Type: application/octet-stream; name=openuri-ftp-auth.patch Content-Transfer-Encoding: Base64 Content-Disposition: attachment; filename=openuri-ftp-auth.patch LS0tIG9wZW4tdXJpLnJiIChzYXZlZCB2ZXJzaW9uKQorKysgKGN1cnJlbnQg ZG9jdW1lbnQpCkBAIC02NTEsOCArNjUxLDEyIEBACiAgICAgICAjIFRoZSBh Y2Nlc3Mgc2VxdWVuY2UgaXMgZGVmaW5lZCBieSBSRkMgMTczOAogICAgICAg ZnRwID0gTmV0OjpGVFAub3BlbihzZWxmLmhvc3QpCiAgICAgICAjIHRvZG86 IGV4dHJhY3QgdXNlci9wYXNzd2QgZnJvbSAubmV0cmMuCi0gICAgICB1c2Vy ID0gJ2Fub255bW91cycKLSAgICAgIHBhc3N3ZCA9IG5pbAorICAgICAgaWYg b3B0aW9ucy5pbmNsdWRlPyA6aHR0cF9iYXNpY19hdXRoZW50aWNhdGlvbgor ICAgICAgICB1c2VyLCBwYXNzd2QgPSBvcHRpb25zWzpodHRwX2Jhc2ljX2F1 dGhlbnRpY2F0aW9uXQorICAgICAgZWxzZQorICAgICAgICB1c2VyID0gJ2Fu b255bW91cycKKyAgICAgICAgcGFzc3dkID0gbmlsCisgICAgICBlbmQKICAg ICAgIHVzZXIsIHBhc3N3ZCA9IHNlbGYudXNlcmluZm8uc3BsaXQoLzovKSBp ZiBzZWxmLnVzZXJpbmZvCiAgICAgICBmdHAubG9naW4odXNlciwgcGFzc3dk KQogICAgICAgZGlyZWN0b3JpZXMuZWFjaCB7fGN3ZHwK --mimepart_4c93bb3e6cb52_eedd1ebb78104e2--