Author: sparky
Date: Sun Aug  8 14:26:33 2010
New Revision: 11769

Modified:
   toys/rsget.pl/Direct/HTTP
Log:
- moved error detection before content-type detection, fixes RSGETPL-34


Modified: toys/rsget.pl/Direct/HTTP
==============================================================================
--- toys/rsget.pl/Direct/HTTP   (original)
+++ toys/rsget.pl/Direct/HTTP   Sun Aug  8 14:26:33 2010
@@ -16,15 +16,16 @@
 start:
        GET( $-{_uri}, headonly => 1 );
 
+       if ( /^Location:\s*\s+/mi ) {
+               LINK( $-{_referer} );
+       }
+       ERROR( "file not found" ) unless m{^HTTP/[\d\.]+ 200}m;
+
        my @type = /^Content-Type:\s*(\S+?)(?:;.*?)?\r?$/mig;
        ! my $type = pop @type;
        my ( $len ) = /^Content-Length:\s*(\d+)\r?$/mi;
        $len ||= -1;
 
-       if ( /^Location:\s*\s+/mi ) {
-               LINK( $-{_referer} );
-       }
-       ERROR( "file not found" ) unless m{^HTTP/1\.\d 200}m;
        if ( $type =~ m#^text/# ) {
                if ( /^Refresh:\s*.*?url=("|'|)(.*?)\1\s*\r$/mi ) {
                        require URI;
_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to