X-Git-Url: http://git.shiar.net/perl/plp/.git/blobdiff_plain/b485fa6bb934e79d44a1be1b5e41e31f4e7129b1..9038784fd549da6452ab9491eae5d3fd5dd9fa42:/lib/PLP/Fields.pm diff --git a/lib/PLP/Fields.pm b/lib/PLP/Fields.pm index cd68e36..52040e3 100644 --- a/lib/PLP/Fields.pm +++ b/lib/PLP/Fields.pm @@ -12,7 +12,7 @@ sub doit { # %get my $get = \%PLP::Script::get; - if (length $ENV{QUERY_STRING}){ + if (defined $ENV{QUERY_STRING} and length $ENV{QUERY_STRING}){ for (split /[&;]/, $ENV{QUERY_STRING}) { my @keyval = split /=/, $_, 2; PLP::Functions::DecodeURI(@keyval); @@ -25,13 +25,10 @@ sub doit { tie %PLP::Script::post, 'PLP::Tie::Delay', 'PLP::Script::post', sub { my %post; - my $post; - - return \%post if $ENV{CONTENT_TYPE} !~ - m!^(?:application/x-www-form-urlencoded|$)!; - - $post = $PLP::read->($ENV{CONTENT_LENGTH}) if $ENV{CONTENT_LENGTH}; + return \%post unless $ENV{CONTENT_TYPE} and $ENV{CONTENT_LENGTH} and + $ENV{CONTENT_TYPE} =~ m!^(?:application/x-www-form-urlencoded|$)!; + my $post = $PLP::read->($ENV{CONTENT_LENGTH}); return \%post unless defined $post and length $post; for (split /&/, $post) { @@ -117,6 +114,10 @@ when sending the headers is the one you used first. The following are equal: $header{Content_Type} $headers{CONTENT_type} +If a value contains newlines, the header is repeated for each line: + + $header{Allow} = "HEAD\nGET"; # equivalent to HEAD,GET + =back =head1 AUTHOR