Author: sparky
Date: Sat Jun 26 23:00:01 2010
New Revision: 11596

Modified:
   toys/rsget.pl/Direct/HTTP
Log:
- return "file not found" on everything but 200 OK


Modified: toys/rsget.pl/Direct/HTTP
==============================================================================
--- toys/rsget.pl/Direct/HTTP   (original)
+++ toys/rsget.pl/Direct/HTTP   Sat Jun 26 23:00:01 2010
@@ -15,8 +15,6 @@
 start:
        GET( $-{_uri}, headonly => 1 );
 
-       ERROR( "file not found" ) if /^HTTP\S+ 404/s;
-
        my @type = /^Content-Type:\s*(\S+?)(?:;.*?)?\r?$/mig;
        ! my $type = pop @type;
        my ( $len ) = /^Content-Length:\s*(\d+)\r?$/mi;
@@ -25,6 +23,7 @@
        if ( /^Location:\s*\s+/mi ) {
                LINK( $-{_referer} );
        }
+       ERROR( "file not found" ) unless m{^HTTP/1\.\d 200}m;
        ERROR( "file is text ($type)" ) if $type =~ m#^text/#;
        ERROR( "file is a small image ($type, $len)" )
                if $type =~ m#^image/# and $len < 100 * 1024;
_______________________________________________
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to