Tom McKenzie 2 жил өмнө
parent
commit
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);
         }