Patches: Browse | Submit New | Admin

[#8309] add usage of uri.userinfo to open-uri.rb

Date:
2007-01-30 14:25
Priority:
3
Submitted By:
Paul Sponagl (pauls)
Assigned To:
Akinori MUSHA (knu)
Category:
Network / Comm / Protocols
State:
Open
Summary:
add usage of uri.userinfo to open-uri.rb

Detailed description
open-uri('http://user:pass@www.host.de/') does not work as expected.


Index: lib/open-uri.rb
===================================================================
--- lib/open-uri.rb     (revision 11598)
+++ lib/open-uri.rb     (working copy)
@@ -121,6 +121,9 @@
     options = rest.shift if !rest.empty? && Hash === rest.first
     raise ArgumentError.new("extra arguments") if !rest.empty?
     options ||= {}
+    if uri.user and uri.password and not options[:http_basic_authentication]
+      options[:http_basic_authentication] = [uri.user,uri.password] 
+    end
     OpenURI.check_options(options)
 
     unless mode == nil ||

adds this...

Add A Comment: Notepad

Please login


Followup

No Followups Have Been Posted

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

Field Old Value Date By
assigned_tonone2007-06-13 06:30zenspider
category_idMisc / Other Standard Library2007-05-30 04:12zenspider
category_idCrypto / Digest / Compression2007-05-30 03:50zenspider
artifact_group_idNone2007-05-30 03:41zenspider