Tom McKenzie 2 лет назад
Родитель
Сommit
e34deb0815
1 измененных файлов с 4 добавлено и 1 удалено
  1. 4 1
      metrics.pl

+ 4 - 1
metrics.pl

@@ -28,7 +28,10 @@ while (my $c = $d->accept) {
     while (my $r = $c->get_request) {
         if ($r->method eq 'GET') {
             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 {
             $c->send_error(RC_FORBIDDEN);
         }