Return http code instead of plain error

This commit is contained in:
Dominik Werder
2021-05-28 22:29:09 +02:00
parent 9b5fd7c9ea
commit 0ad59af010
2 changed files with 12 additions and 6 deletions

View File

@@ -263,7 +263,7 @@ async fn binned(req: Request<Body>, node_config: &NodeConfigCached) -> Result<Re
match head.headers.get("accept") {
Some(v) if v == "application/octet-stream" => binned_binary(query, node_config).await,
Some(v) if v == "application/json" => binned_json(query, node_config).await,
_ => Err(Error::with_msg("binned with unknown accept")),
_ => Ok(response(StatusCode::NOT_ACCEPTABLE).body(Body::empty())?),
}
}