SVN: toys/rsget.pl/Direct/HTTP
sparky
sparky at pld-linux.org
Sat Jun 26 23:00:01 CEST 2010
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;
More information about the pld-cvs-commit
mailing list