mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-22 14:24:44 +00:00
Started aligning API spec with implementation.
- Adding some missing fields to structs
- Rearranged the endpoints in the rest_api router, and renamed, using an 'implementation_pending' function
- Added 'content-type' headers, to distinguish difference with /node/metrics
- Updated OpenAPI spec to v0.2.0
- Split /node/fork into /node/chain_id and /beacon/fork
- Moved /metrics to /node/metrics
- Added example to /node/metrics, since it's text/plain
- Moved /node/network to just /network
- Added lots of stubs for endpoints which exist in the router
- Reordered large parts of the OpenAPI spec
- Moved /chain/beacon/... to just /beacon/...
This commit is contained in:
@@ -64,6 +64,14 @@ pub fn get_prometheus<T: BeaconChainTypes + 'static>(req: Request<Body>) -> ApiR
|
||||
.unwrap();
|
||||
|
||||
String::from_utf8(buffer)
|
||||
.map(|string| success_response(Body::from(string)))
|
||||
.map(|string| {
|
||||
let mut response = success_response(Body::from(string));
|
||||
// Need to change the header to text/plain for prometheius
|
||||
response
|
||||
.headers_mut()
|
||||
.insert("content-type", "text/plain; charset=utf-8".parse().unwrap())
|
||||
.unwrap();
|
||||
response
|
||||
})
|
||||
.map_err(|e| ApiError::ServerError(format!("Failed to encode prometheus info: {:?}", e)))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user