Downloading an extension via configure sometimes ends in the following error message:
"Invalid header block at offset unknown at /path/to/twiki/lib/TWiki/Configure/UIs/EXTEND.pm line 311"
Reason: The HTTP headers are concatenated to the archive.
--
TWiki:Main.OliverKrueger - 16 May 2007
FIXED.
--
TWiki:Main.OliverKrueger - 16 May 2007
performed minor cleanup:
Index: lib/TWiki/Configure/UIs/EXTEND.pm
===================================================================
--- lib/TWiki/Configure/UIs/EXTEND.pm (revision 13775)
+++ lib/TWiki/Configure/UIs/EXTEND.pm (working copy)
@@ -90,9 +90,7 @@
}
# Strip HTTP headers if necessary
- if ( $ar =~ m/^HTTP/sm ) {
- $ar =~ s/^HTTP(.*?)\r\n\r\n(.*)/$2/sm;
- }
+ $ar =~ s/^HTTP(.*?)\r\n\r\n//sm;
# Save it somewhere it will be cleaned up
my ($tmp, $tmpfilename) = File::Temp::tempfile(SUFFIX => $ext, UNLINK=>1);
using the following test:
#! /usr/bin/perl -w
use strict;
my $ar = "HTTP some text\r\n\r\nsome random text\n\nfinally some more to confuse greedy?\r\n\r\nfinally the end...";
print "ar=[$ar]\n";
# Strip HTTP headers if necessary
$ar =~ s/^HTTP(.*?)\r\n\r\n//sm;
#if ( $ar =~ m/^HTTP/sm ) {
# $ar =~ s/^HTTP(.*?)\r\n\r\n(.*)/$2/sm;
#}
print "ar=[$ar]\n";
WN