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
This commit is contained in:
Paul Hauner 2020-12-01 00:04:46 +00:00
parent 075eecdcb1
commit b8bd80d2fb
2 changed files with 2 additions and 0 deletions

View File

@ -116,6 +116,7 @@ pub fn serve<T: BeaconChainTypes>(
.unwrap_or_else(|e| {
Response::builder()
.status(500)
.header("Content-Type", "text/plain")
.body(format!("Unable to gather metrics: {:?}", e))
.unwrap()
}),

View File

@ -123,6 +123,7 @@ pub fn serve<T: EthSpec>(
.unwrap_or_else(|e| {
Response::builder()
.status(500)
.header("Content-Type", "text/plain")
.body(format!("Unable to gather metrics: {:?}", e))
.unwrap()
}),