Allowing repeated HTTP headers (RFC2616 ยง4.2) even though this didn't
add much value afterall (one may also use commas). It does prevent
(accidentally) malformed header values though, as most servers don't
seem to handle continuation lines.
+- %header values containing newlines will be sent as multiple fields
- All modules use warnings and contain a $VERSION
- Fix META.yml syntax
- lvalue %cookie (similar to AddCookie)
- multipart posts [3.21]
- install rules for servers
-- %header takes array ref
- test plp parsing
- redisplay include errors [3.21]
- object instead of $PLP::
sub sendheaders () {
$PLP::sentheaders ||= [ caller 1 ? (caller 1)[1, 2] : (caller)[1, 2] ];
print STDOUT "Content-Type: text/plain\n\n" if $PLP::DEBUG & 2;
- print STDOUT map("$_: $PLP::Script::header{$_}\n", keys %PLP::Script::header), "\n";
+ while (my ($header, $values) = each %PLP::Script::header) {
+ print STDOUT "$header: $_\n" for split /\n/, $values;
+ }
+ print STDOUT "\n";
}
{
$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
sub AddCookie ($) {
if ($PLP::Script::header{'Set-Cookie'}) {
- $PLP::Script::header{'Set-Cookie'} .= "\nSet-Cookie: $_[0]";
+ $PLP::Script::header{'Set-Cookie'} .= "\n" . $_[0];
} else {
$PLP::Script::header{'Set-Cookie'} = $_[0];
}