Changeset 18691

Show
Ignore:
Timestamp:
09/03/08 01:35:09 (6 years ago)
Author:
tokuhirom
Message:

quick & silly bug fix.
HTTP ENGINE DOES NOT SUPPORT PROXY SERVER

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/misc/WassrPod/wassrpod.pl

    r18682 r18691  
    5353    my($self, $req) = @_; 
    5454 
    55     if ($req->path eq '/http://twitter.com/statuses/friends_timeline.xml') { 
     55    (my $path = $req->path) =~ s!^//!/http://!; # work around, "HTTP::Engine does not support proxy server" 
     56 
     57    if ($path eq '/http://twitter.com/statuses/friends_timeline.xml') { 
    5658        HTTP::Engine::Response->new( 
    5759            content_type => 'application/xml', 
    5860            body         => $self->friends_timeline($req), 
    5961        ); 
    60     } elsif ($req->path eq '/http://twitter.com/statuses/update.xml') { 
     62    } elsif ($path eq '/http://twitter.com/statuses/update.xml') { 
    6163        HTTP::Engine::Response->new( 
    6264            content_type => 'application/xml', 
    6365            body         => $self->update($req), 
    6466        ); 
    65     } elsif ($req->path =~ '^/http://wassr.jp/.*$') { 
     67    } elsif ($path =~ '^/http://wassr.jp/.*$') { 
    6668        my $ua = ua($req, 'wassr.jp'); 
    6769        my $res = $ua->get($req->path); 
     
    7173        $heres; 
    7274    } else { 
    73         warn "INVALID PATH: " . $req->path; 
     75        warn "INVALID PATH: " . $path; 
    7476        HTTP::Engine::Response->new( status => 404, body => 'not found' ); 
    7577    }