Welcome to the "trac"-ing site of http-access2!
[soap4r] [httpclient] [openpgp4u] [pkcs1] [logger] [csv] [vtr]

Changeset 128

Show
Ignore:
Timestamp:
11/04/06 17:02:16 (3 years ago)
Author:
nahi
Message:
  • merged patch from Pranay about Proxy Authorization
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/http-access2.rb

    r127 r128  
    109109  def initialize(proxy = nil, agent_name = nil, from = nil) 
    110110    @proxy = nil        # assigned later. 
     111    @proxy_auth = nil 
    111112    @no_proxy = nil 
    112113    @agent_name = agent_name 
     
    184185        raise ArgumentError.new("unsupported proxy `#{proxy}'") 
    185186      end 
     187      @proxy_auth = [@proxy.user, @proxy.password] 
    186188    end 
    187189    reset_all 
     
    396398    if extheader.is_a?(Hash) 
    397399      extheader = extheader.to_a 
     400    end 
     401    if @proxy_auth 
     402      proxy_cred = ["#{@proxy_auth[0]}:#{@proxy_auth[1]}"].pack('m').strip 
     403      extheader << ['Proxy-Authorization', "Basic " << proxy_cred] 
    398404    end 
    399405    cred = @basic_auth.get(uri)