Changeset 241

Show
Ignore:
Timestamp:
09/07/01 13:25:43
Author:
miyagawa
Message:

added exclude()
documentation upgrade

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Apache-No404Proxy/trunk/Changes

    r210 r241  
    11Revision history for Perl extension Apache::No404Proxy. 
     2 
     30.02  Fri Sep  7 13:24:19 JST 2001 
     4        * Added exclusion for images (not complete) 
     5        - Documentation for Google ToS 
     6        - Minor documentation fix 
    27 
    380.01  Sun Aug 19 06:49:59 2001 
  • Apache-No404Proxy/trunk/README

    r213 r241  
    44SYNOPSIS 
    55      # in httpd.conf 
    6       PerlTransHandler Apache::No404Proxy 
     6      PerlTransHandler Apache::No404Proxy # default uses ::Google 
    77 
    88DESCRIPTION 
     
    1111    Apache::No404Proxy serves as a proxy server, which automaticaly detects 
    1212    404 responses and redirects your browser to Google cache. 
     13 
     14    Set your browser's proxy setting to Apache::No404Proxy based server, and 
     15    it becomes 404 free now! 
    1316 
    1417SUBCLASSING 
     
    3740    that represents URI. 
    3841 
     42    At last, remember to add the following line to httpd.conf: 
     43 
     44      PerlTransHandler Apache::No404Proxy::Google 
     45 
     46RESTRICTIONS FOR USE 
     47    Use of this proxy is restricted for personal use. Otherwise, you may or 
     48    may not break terms of service of Google. See 
     49    http://www.google.com/terms_of_service.html for details. 
     50 
    3951AUTHOR 
    4052    Tastuhiko Miyagawa <miyagawa@bulknews.net> 
     
    4355    under the same terms as Perl itself. 
    4456 
     57    This module comes WITHOUT ANY WARRANTY. 
     58 
    4559SEE ALSO 
    4660    the Apache::ProxyPassThru manpage, the LWP::UserAgent manpage, the 
  • Apache-No404Proxy/trunk/lib/Apache/No404Proxy.pm

    r216 r241  
    3232    my $res = LWP::UserAgent->new->simple_request($request); 
    3333    $r->content_type($res->header('Content-type')); 
    34     if ($res->code == 404) { 
     34    if ($res->code == 404 && ! $class->exclude($r->uri)) { 
    3535        my $cache = $class->translate($r->uri); 
    3636        # detect LOOP 
     
    6161} 
    6262 
     63# default excludes image files 
     64sub exclude { 
     65    my($class, $uri) = @_; 
     66    return $uri =~ /\.(?:gif|jpe?g|png)$/i; 
     67} 
     68 
    6369sub translate { 
    6470    my($class, $uri) = @_; 
     
    8086 
    8187  # in httpd.conf 
    82   PerlTransHandler Apache::No404Proxy 
     88  PerlTransHandler Apache::No404Proxy # default uses ::Google 
    8389 
    8490=head1 DESCRIPTION 
     
    8894Apache::No404Proxy serves as a proxy server, which automaticaly 
    8995detects 404 responses and redirects your browser to Google cache. 
     96 
     97Set your browser's proxy setting to Apache::No404Proxy based server, 
     98and it becomes 404 free now! 
    9099 
    91100=head1 SUBCLASSING 
     
    127136At last, remember to add the following line to httpd.conf: 
    128137 
    129   PerlHandler Apache::No404Proxy::Google 
     138  PerlTransHandler Apache::No404Proxy::Google 
     139 
     140=head1 RESTRICTIONS FOR USE 
     141 
     142Use of this proxy is restricted for personal use. Otherwise, you may 
     143or may not break terms of service of Google. See 
     144http://www.google.com/terms_of_service.html for details. 
    130145 
    131146=head1 AUTHOR 
     
    136151it under the same terms as Perl itself. 
    137152 
     153This module comes B<WITHOUT ANY WARRANTY>. 
     154 
    138155=head1 SEE ALSO 
    139156