Browse files

Fixed bugs found during tests with mod_scgi on apache 2.2

  • Loading branch information...
1 parent b73aebe commit 73a3332a6f1206fd41399d058b90da735ecac4f7 @supernovus committed Feb 27, 2010
Showing with 4 additions and 2 deletions.
  1. +4 −2 SCGI.pm
View
6 SCGI.pm
@@ -24,10 +24,12 @@ class SCGI::Request {
my $comma = $.request.substr($offset+$length, 1);
return self.err("malformed netstring, expecting terminating comma, found \"$comma\"") if $comma ne ',';
$.body = $.request.substr($offset+$length+1);
- %.env = $env_string.split("\0");
+ my @env = $env_string.split("\0");
+ @env.pop;
+ %.env = @env;
if $!strict {
return self.err("malformed or missing CONTENT_LENGTH header")\
- unless %.env<CONTENT_LENGTH> \
+ unless defined %.env<CONTENT_LENGTH> \
&& %.env<CONTENT_LENGTH> ~~ / ^ \d+ $ /;
return self.err("missing SCGI header")\
unless %.env<SCGI> && %.env<SCGI> eq '1';

0 comments on commit 73a3332

Please sign in to comment.