=item output_html_with_http_headers
- &output_html_with_http_headers($query, $cookie, $html[, $content_type])
+ &output_html_with_http_headers($query, $cookie, $html[, $content_type][, status])
Outputs the HTML page $html with the appropriate HTTP headers,
with the authentication cookie $cookie and a Content-Type that
=cut
-sub output_html_with_http_headers ($$$;$) {
+sub output_html_with_http_headers ($$$;$$) {
my $query = shift;
my $cookie = shift;
my $html = shift;
//gx;
my $content_type = @_ ? shift : "text/html";
+ my $status = shift;
$content_type = "text/html" unless $content_type =~ m!/!; # very basic sanity check
print $query->header(
+ -status => $status,
-type => $content_type,
-charset => 'UTF-8',
-cookie => $cookie,
}
);
$template->param( admin => $admin );
-output_with_http_headers $query, $cookie, $template->output, 'html', '400 Bad Request';
+output_html_with_http_headers $query, $cookie, $template->output, 'html', '400 Bad Request';
}
);
$template->param( admin => $admin );
-output_with_http_headers $query, $cookie, $template->output, 'html', '401 Unauthorized';
+output_html_with_http_headers $query, $cookie, $template->output, 'html', '401 Unauthorized';
}
);
$template->param( admin => $admin );
-output_with_http_headers $query, $cookie, $template->output, 'html', '402 Payment Required';
+output_html_with_http_headers $query, $cookie, $template->output, 'html', '402 Payment Required';
}
);
$template->param( admin => $admin );
-output_with_http_headers $query, $cookie, $template->output, 'html', '403 Forbidden';
+output_html_with_http_headers $query, $cookie, $template->output, 'html', '403 Forbidden';
}
);
$template->param( admin => $admin );
-output_with_http_headers $query, $cookie, $template->output, 'html', '404 Not Found';
+output_html_with_http_headers $query, $cookie, $template->output, 'html', '404 Not Found';
}
);
$template->param( admin => $admin );
-output_with_http_headers $query, $cookie, $template->output, 'html', '500 Internal Server Error';
+output_html_with_http_headers $query, $cookie, $template->output, 'html', '500 Internal Server Error';