Changeset 1254

Show
Ignore:
Timestamp:
08/09/06 22:40:15
Author:
miyagawa
Message:

move AuthenRequest? hook to useragent.init

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/plagger/lib/Plagger/Plugin/UserAgent/AuthenRequest.pm

    r1248 r1254  
    1111    $context->register_hook( 
    1212        $self, 
    13         'useragent.request' => \&add_credentials, 
     13        'useragent.init' => \&add_credentials, 
    1414    ); 
    1515} 
     
    2020    my $creds = $self->conf->{credentials} || [ $self->conf ]; 
    2121 
    22     my $uri = URI->new($args->{url}); 
    23     for my $auth (grep { $_->{host} eq $uri->host_port } @$creds) { 
     22    for my $auth (@$creds) { 
    2423        $context->log(info => "Adding credential to $auth->{realm} at $auth->{host}"); 
    2524        $args->{ua}->credentials($auth->{host}, $auth->{realm}, $auth->{username}, $auth->{password}); 
  • trunk/plagger/lib/Plagger/UserAgent.pm

    r1248 r1254  
    1818    $self->timeout( $conf->{timeout} || 15 ); 
    1919    $self->env_proxy(); 
     20 
     21    Plagger->context->run_hook('useragent.init', { ua => $self }); 
    2022 
    2123    $self;