fix: content handler and redirects

This commit is contained in:
JT Smith 2008-01-25 01:36:14 +00:00
parent c776703568
commit fb434a8b3a
26 changed files with 74 additions and 542 deletions

View file

@ -115,7 +115,7 @@ sub handler {
$http->setStatus("304","Content Not Modified");
$http->sendHeader;
$session->close;
return "cached";
return "chunked";
}
# return the page.
@ -137,13 +137,6 @@ sub handler {
}
}
# Uhm... why here and not somewhere else? Do content handlers manage their own content
# or should the URL handlers do it for them?
if ($output eq "redirect") {
$http->sendHeader;
}
# ...
return $output;
}

View file

@ -47,10 +47,7 @@ The content handler for this package.
sub handler {
my ($session) = @_;
if ($session->env->get("HTTP_X_MOZ") eq "prefetch") { # browser prefetch is a bad thing
my $http = $session->http;
$http->setStatus("403","We don't allow prefetch, because it increases bandwidth, hurts stats, and can break web sites.");
$http->sendHeader;
return "none";
$session->http->setStatus("403","We don't allow prefetch, because it increases bandwidth, hurts stats, and can break web sites.");
}
return undef;
}

View file

@ -560,7 +560,6 @@ return props[propName];
<img src="'.$session->url->extras('background.jpg').'" style="border-style:none;position: absolute; top: 0; left: 0; width: 100%; height: 1000px; z-index: 1;" />
</body> </html>';
$session->http->setMimeType("text/html");
$session->http->sendHeader;
return $page;
}