From b8bd80d2fbd47c0e12295546322fc7c2b9a13776 Mon Sep 17 00:00:00 2001 From: Paul Hauner Date: Tue, 1 Dec 2020 00:04:46 +0000 Subject: [PATCH] Add Content-Type to metrics server (#2019) ## Issue Addressed - Resolves #2013 ## Proposed Changes Adds the `Content-Type text/plain` header as per #2013 ## Additional Info NA --- beacon_node/http_metrics/src/lib.rs | 1 + validator_client/src/http_metrics/mod.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/beacon_node/http_metrics/src/lib.rs b/beacon_node/http_metrics/src/lib.rs index e3238caae5..4837d513b5 100644 --- a/beacon_node/http_metrics/src/lib.rs +++ b/beacon_node/http_metrics/src/lib.rs @@ -116,6 +116,7 @@ pub fn serve( .unwrap_or_else(|e| { Response::builder() .status(500) + .header("Content-Type", "text/plain") .body(format!("Unable to gather metrics: {:?}", e)) .unwrap() }), diff --git a/validator_client/src/http_metrics/mod.rs b/validator_client/src/http_metrics/mod.rs index 32227172ab..1e1c63640a 100644 --- a/validator_client/src/http_metrics/mod.rs +++ b/validator_client/src/http_metrics/mod.rs @@ -123,6 +123,7 @@ pub fn serve( .unwrap_or_else(|e| { Response::builder() .status(500) + .header("Content-Type", "text/plain") .body(format!("Unable to gather metrics: {:?}", e)) .unwrap() }),