| 131 |
|
|
| 132 |
sub output ($;%) { |
sub output ($;%) { |
| 133 |
my ($self, %opt) = @_; |
my ($self, %opt) = @_; |
| 134 |
|
## Note: CGI/1.1 draft 3 recommends ("SHOULD") that |
| 135 |
|
## "\x0A" should be used as new line in AmigaDOS and Un*x environments. |
| 136 |
my $nl = $opt{output} eq 'http-cgi' ? "\n" : "\x0D\x0A"; |
my $nl = $opt{output} eq 'http-cgi' ? "\n" : "\x0D\x0A"; |
| 137 |
binmode STDOUT; |
binmode STDOUT; |
| 138 |
$| = 1; |
$| = 1; |
| 197 |
} elsif ($self->{wiki}->{var}->{client}->{user_agent_name} |
} elsif ($self->{wiki}->{var}->{client}->{user_agent_name} |
| 198 |
=~ m#Mozilla/0\.|Infomosaic#) { |
=~ m#Mozilla/0\.|Infomosaic#) { |
| 199 |
} else { |
} else { |
| 200 |
print qq(; charset="$charset"); |
print qq(; charset=).$self->___quote_word ($charset); |
| 201 |
} |
} |
| 202 |
} |
} |
| 203 |
print $nl; |
print $nl; |
| 210 |
print $body; |
print $body; |
| 211 |
} |
} |
| 212 |
|
|
| 213 |
|
## Note: CGI/1.1 draft 3 does not allow HTTP Header Fields |
| 214 |
|
## when Location: field is outputed. This module does |
| 215 |
|
## NOT follow that requirement. The draft allows |
| 216 |
|
## message-body explicitly, even if there is Location:. |
| 217 |
|
## Therefore at least entity-header fields should be allowed. |
| 218 |
|
|
| 219 |
|
## TODO: REDIRECT_URI support |
| 220 |
|
|
| 221 |
=item $self->exit |
=item $self->exit |
| 222 |
|
|
| 223 |
Declares the instance ($self) no longer considered useful. |
Declares the instance ($self) no longer considered useful. |
| 237 |
$self->exit unless $self->{exited}; |
$self->exit unless $self->{exited}; |
| 238 |
} |
} |
| 239 |
|
|
| 240 |
|
sub ___quote_word ($$) { |
| 241 |
|
my ($self, $s) = @_; |
| 242 |
|
if ($s =~ /[^0-9A-Za-z_.+-]/) { |
| 243 |
|
$s =~ s/([\\"])/\\$1/g; |
| 244 |
|
return qq<"$s">; |
| 245 |
|
} else { |
| 246 |
|
return $s; |
| 247 |
|
} |
| 248 |
|
} |
| 249 |
|
|
| 250 |
=item $self->{entity}->{charset} |
=item $self->{entity}->{charset} |
| 251 |
=item $self->{entity}->{language} = [...] |
=item $self->{entity}->{language} = [...] |
| 252 |
=item $self->{entity}->{media_type} |
=item $self->{entity}->{media_type} |