fix: content handler and redirects
This commit is contained in:
parent
c776703568
commit
fb434a8b3a
26 changed files with 74 additions and 542 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue