|
@@ -28,7 +28,10 @@ while (my $c = $d->accept) {
|
|
|
while (my $r = $c->get_request) {
|
|
while (my $r = $c->get_request) {
|
|
|
if ($r->method eq 'GET') {
|
|
if ($r->method eq 'GET') {
|
|
|
my $response_text = generate_response();
|
|
my $response_text = generate_response();
|
|
|
- $c->send_response(HTTP::Response->new(RC_OK, undef, undef, $response_text));
|
|
|
|
|
|
|
+ my $response = HTTP::Response->new(RC_OK);
|
|
|
|
|
+ $response->header('Content-Type' => 'text/plain');
|
|
|
|
|
+ $response->content($response_text);
|
|
|
|
|
+ $c->send_response($response);
|
|
|
} else {
|
|
} else {
|
|
|
$c->send_error(RC_FORBIDDEN);
|
|
$c->send_error(RC_FORBIDDEN);
|
|
|
}
|
|
}
|