Restructured response builder to give YAML or JSON when SSZ is not available, not just JSON.

This commit is contained in:
Luke Anderson
2019-09-13 20:42:56 +10:00
parent 1dd86baf1a
commit f48311900e
8 changed files with 76 additions and 48 deletions

View File

@@ -62,6 +62,6 @@ pub fn get_prometheus<T: BeaconChainTypes + 'static>(req: Request<Body>) -> ApiR
.unwrap();
String::from_utf8(buffer)
.map(|string| ResponseBuilder::new(&req).body_text(string))
.map(|string| ResponseBuilder::new(&req)?.body_text(string))
.map_err(|e| ApiError::ServerError(format!("Failed to encode prometheus info: {:?}", e)))?
}