File tree Expand file tree Collapse file tree
simpleclient_httpserver/src/main/java/io/prometheus/client/exporter Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -65,15 +65,15 @@ public void handle(HttpExchange t) throws IOException {
6565
6666 t .getResponseHeaders ().set ("Content-Type" ,
6767 TextFormat .CONTENT_TYPE_004 );
68- t .getResponseHeaders ().set ("Content-Length" ,
69- String .valueOf (response .size ()));
7068 if (shouldUseCompression (t )) {
7169 t .getResponseHeaders ().set ("Content-Encoding" , "gzip" );
7270 t .sendResponseHeaders (HttpURLConnection .HTTP_OK , 0 );
7371 final GZIPOutputStream os = new GZIPOutputStream (t .getResponseBody ());
7472 response .writeTo (os );
7573 os .finish ();
7674 } else {
75+ t .getResponseHeaders ().set ("Content-Length" ,
76+ String .valueOf (response .size ()));
7777 t .sendResponseHeaders (HttpURLConnection .HTTP_OK , response .size ());
7878 response .writeTo (t .getResponseBody ());
7979 }
You can’t perform that action at this time.
0 commit comments