Add content disposition for OK responses (#2545)

This commit is contained in:
Mark Renten
2019-02-11 13:54:21 -05:00
committed by Ignotus Peverell
parent 200f87b8bc
commit 3b74a9ba3f
3 changed files with 20 additions and 9 deletions
+2 -2
View File
@@ -56,7 +56,7 @@ pub struct ChainValidationHandler {
impl Handler for ChainValidationHandler {
fn get(&self, _req: Request<Body>) -> ResponseFuture {
match w(&self.chain).validate(true) {
Ok(_) => response(StatusCode::OK, ""),
Ok(_) => response(StatusCode::OK, "{}"),
Err(e) => response(
StatusCode::INTERNAL_SERVER_ERROR,
format!("validate failed: {}", e),
@@ -75,7 +75,7 @@ pub struct ChainCompactHandler {
impl Handler for ChainCompactHandler {
fn post(&self, _req: Request<Body>) -> ResponseFuture {
match w(&self.chain).compact() {
Ok(_) => response(StatusCode::OK, ""),
Ok(_) => response(StatusCode::OK, "{}"),
Err(e) => response(
StatusCode::INTERNAL_SERVER_ERROR,
format!("compact failed: {}", e),
+1 -1
View File
@@ -97,6 +97,6 @@ impl Handler for PeerHandler {
_ => return response(StatusCode::BAD_REQUEST, "invalid command"),
};
response(StatusCode::OK, "")
response(StatusCode::OK, "{}")
}
}